llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.75k stars 11.89k forks source link

[LLVM][LLD][LTO] Profile Guided Layout (--call-graph-profile-sort) does not work with FullLTO #56185

Closed bd1976bris closed 2 years ago

bd1976bris commented 2 years ago

The CGProfilePass is not run as part of compiling the LTO object file with FullLTO, as a consequence the .llvm.call-graph-profile section is not emitted into the LTO object file and profile guided layout (--call-graph-profile-sort) does not occur.

Profile guided layout does currently work with both ThinLTO and with normal compilation as the CGProfilePass is run appropriately for both.

bd1976bris commented 2 years ago

Review for potential fix: https://reviews.llvm.org/D128452

MaskRay commented 2 years ago

Try avoiding uncommon abbreviations like PGL, FLTO, and TLTO :)