This is an archive of the discontinued LLVM Phabricator instance.

[Propeller] Promote functions with propeller profiles to .text.hot.
AbandonedPublic

Authored by rahmanl on May 26 2022, 7:09 PM.

Details

Reviewers
None
Summary

Today, text section prefixes (none, .unlikely, .hot, and .unkown) are determined based on PGO profile. However, Propeller may deem a function hot when PGO doesn't. Besides, when -Wl,-keep-text-section-prefix=true Propeller cannot enforce a global section ordering as the linker can only reorder sections within each output section (.text, .text.hot, .text.unlikely).

This patch promotes all functions with Propeller profiles (functions listed in the basic-block-sections profile) to .text.hot. The feature is hidden behind the flag --bbsections-guided-section-prefix which defaults to true.

The new implementation refactors the parsing of basic block sections profile into a new BasicBlockSectionsProfileReader analysis pass. This allows us to use the information earlier in CodeGenPrepare in order to set the functions text prefix. BasicBlockSectionsProfileReader will be used both by BasicBlockSections pass and CodeGenPrepare.

Fix amdgpu test. Originally reviewed in D122930.

Diff Detail

Event Timeline

rahmanl created this revision.May 26 2022, 7:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 26 2022, 7:09 PM
rahmanl requested review of this revision.May 26 2022, 7:09 PM
rahmanl abandoned this revision.May 26 2022, 7:18 PM