This is an archive of the discontinued LLVM Phabricator instance.

Avoid running optimization passes in frontend test
ClosedPublic

Authored by MatzeB on Aug 9 2023, 9:39 AM.

Diff Detail

Event Timeline

MatzeB created this revision.Aug 9 2023, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 9:39 AM
MatzeB requested review of this revision.Aug 9 2023, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2023, 9:39 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
MatzeB updated this revision to Diff 548655.Aug 9 2023, 9:50 AM

Decided to just use "utils/update_cc_test_checks.py" so we can inspect the generate llvm.expect calls directly.

MatzeB edited the summary of this revision. (Show Details)Aug 9 2023, 9:50 AM
aeubanks accepted this revision.Aug 9 2023, 9:53 AM

seems fine if nobody else objects

This revision is now accepted and ready to land.Aug 9 2023, 9:53 AM
MatzeB updated this revision to Diff 548657.Aug 9 2023, 9:56 AM
wenlei added inline comments.Sep 5 2023, 7:29 AM
clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
147–148

I thought this is the purpose of the test, which is no longer checked after change?

aeubanks added inline comments.Sep 5 2023, 9:58 AM
clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
147–148

those should be covered by LowerExpectIntrinsic tests

MatzeB marked 2 inline comments as done.Sep 5 2023, 11:21 AM
MatzeB added inline comments.
clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
147–148

The frontend rewrites [[likely]] and [[unlikely]] into calls to llvm.expect. And this is still tested here. Running lower-expect-intrinsic pass to lower the llvm.expect to !prof annotations doesn't need to be tested here as we have separate tests for that pass.

wenlei accepted this revision.Sep 5 2023, 11:35 AM

lgtm, thanks.

clang/test/CodeGenCXX/attr-likelihood-if-branch-weights.cpp
147–148

Ah, makes sense. I see that we have existing coverage for lowering llvm.expect to !prof in expect-*.ll, so we're good.

This revision was automatically updated to reflect the committed changes.