This is an archive of the discontinued LLVM Phabricator instance.

[InstrProf] Add options to profile function groups
ClosedPublic

Authored by ellis on Jul 12 2022, 2:05 PM.

Details

Summary

Add two options, -fprofile-function-groups=N and -fprofile-selected-function-group=i used to partition functions into N groups and only instrument the functions in group i. Similar options were added to xray in https://reviews.llvm.org/D87953 and the goal is the same; to reduce instrumented size overhead by spreading the overhead across multiple builds. Raw profiles from different groups can be added like normal using the llvm-profdata merge command.

Diff Detail

Event Timeline

ellis created this revision.Jul 12 2022, 2:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 2:05 PM
Herald added a subscriber: Enna1. · View Herald Transcript
ellis edited the summary of this revision. (Show Details)Jul 12 2022, 2:31 PM
ellis updated this revision to Diff 444091.Jul 12 2022, 3:28 PM

Add docs

ellis edited the summary of this revision. (Show Details)Jul 12 2022, 3:43 PM
ellis updated this revision to Diff 444108.Jul 12 2022, 4:29 PM

Fix test

ellis published this revision for review.Jul 13 2022, 9:16 AM
ellis edited the summary of this revision. (Show Details)
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 13 2022, 9:18 AM
Herald added subscribers: Restricted Project, cfe-commits. · View Herald Transcript
ianlevesque added inline comments.Jul 13 2022, 10:02 AM
clang/lib/CodeGen/CodeGenModule.cpp
2882

In D87953 I used crc32 to avoid computing an md5 hash on every function name.

ellis added inline comments.Jul 13 2022, 10:23 AM
clang/lib/CodeGen/CodeGenModule.cpp
2882

I see, I'll change that. Thanks!

ellis updated this revision to Diff 444327.Jul 13 2022, 10:24 AM

Use crc32 rather than md5 to compute function hashes faster.

This revision is now accepted and ready to land.Jul 13 2022, 1:16 PM
This revision was automatically updated to reflect the committed changes.