This is an archive of the discontinued LLVM Phabricator instance.

Use -fprofile-use= when TEST_SUITE_USE_IR_PGO is enabled
ClosedPublic

Authored by MatzeB on Sep 19 2022, 10:15 AM.

Details

Summary

TEST_SUITE_USE_IR_PGO changes the test-suite to use -fprofile-generate=xxx (instead of -fprofile-instr-gen=xxx). This changes cmake to also use -fprofile-use=xxx (instead of -fprofile-instr-use=xxx).

This change is cosmetic: It turns out -fprofile-instr-use does automatically detect the profile format used and works either way. But picking the matching use-flag can avoid confusion for people inspecting the compiler flags.

Diff Detail

Repository
rT test-suite

Event Timeline

MatzeB created this revision.Sep 19 2022, 10:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2022, 10:15 AM
MatzeB requested review of this revision.Sep 19 2022, 10:15 AM
MatzeB edited the summary of this revision. (Show Details)
fhahn accepted this revision.Sep 26 2022, 5:55 AM

This looks reasonable, LGTM, thanks!

This revision is now accepted and ready to land.Sep 26 2022, 5:55 AM
This revision was automatically updated to reflect the committed changes.
fhahn added inline comments.Sep 30 2022, 12:40 AM
cmake/modules/TestSuite.cmake
62

I missed that this also changes to path passed to -fprofile-instr-use from ${target_path}.profdata to ${TEST_SUITE_PROFILE_PATH}/${target}.profdata. The new path doesn't appear to work correctly when using lnt + PGO.

From the description, it doesn't seem like this change was intentional, so I reverted the change for now to get that original configuration working again.