This is an archive of the discontinued LLVM Phabricator instance.

[InstrProf] Allow compiler generated functions in SCL
AbandonedPublic

Authored by ellis on Jul 8 2022, 5:43 PM.

Details

Reviewers
kyulee
phosek
Summary

Allow compiler generated functions like __clang_call_terminate to be
blocked in the special case list (SCL) passed by the -fprofile-list= option.

Diff Detail

Event Timeline

ellis created this revision.Jul 8 2022, 5:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2022, 5:43 PM
ellis published this revision for review.Jul 11 2022, 10:31 AM
ellis retitled this revision from [instrprof] Allow compiler generated functions in SCL to [InstrProf] Allow compiler generated functions in SCL.
ellis edited the summary of this revision. (Show Details)
ellis added reviewers: kyulee, phosek.
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 10:32 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
ellis added inline comments.Jul 11 2022, 10:59 AM
clang/lib/CodeGen/CodeGenModule.cpp
3894–3896

Both are needed. Here the attribute is added in GetOrCreateLLVMFunction() which I believe only creates compiler generated functions. Where you linked is called when normal functions are generated.

phosek accepted this revision.Jul 11 2022, 11:00 AM

LGTM

This revision is now accepted and ready to land.Jul 11 2022, 11:00 AM
kyulee accepted this revision.Jul 11 2022, 11:04 AM
ellis planned changes to this revision.Jul 11 2022, 7:30 PM
ellis added inline comments.
clang/lib/CodeGen/CodeGenModule.cpp
3894–3896

Oh sorry, I was mistaken. I'd like to figure out how to only have this code in one location.

ellis abandoned this revision.Jul 12 2022, 2:10 PM

The function __clang_call_terminate seems to be a special case that clang builds itself. This diff might be too much for this rare specific case. Closing.