This is an archive of the discontinued LLVM Phabricator instance.

[misexpect] Support diagnostics from frontend profile data
Needs ReviewPublic

Authored by paulkirth on Aug 3 2022, 8:35 PM.

Details

Summary

Adds support for suggesting profitable llvm.expect based on frontend
profiling instrumentation.

Diff Detail

Event Timeline

paulkirth created this revision.Aug 3 2022, 8:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2022, 8:35 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
paulkirth updated this revision to Diff 450193.Aug 4 2022, 5:25 PM

Fix tests and fronend integration

paulkirth published this revision for review.Aug 17 2022, 6:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2022, 6:38 PM

I'm not sure of the status of these patches, since the base one is still marked "WIP". Some comments below on this patch, but are they all ready for review? If so, WIP should probably be removed from D129889.

llvm/include/llvm/Target/TargetOptions.h
366

Needs its own comment.

llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
366

I take it a return value of false from then handle*Expect functions means there was not an expect? Would be good to note this in a comment (here and in the switch handling later). Also, suggest moving this down into lowerExpectIntrinsic to mirror where/how switch are handled.

llvm/lib/Transforms/Utils/MisExpect.cpp
311

It doesn't seem like this patch includes a test for this new invocation of verifyMissingAnnotations - can one be added?

317

Should these commented out lines be removed now?