llvm-project/llvm/lib/Passes
Ben Dunbobbin 325e7e8b87 [LLVM][LTO][LLD] Enable Profile Guided Layout (--call-graph-profile-sort) for FullLTO
The CGProfilePass needs to be run during FullLTO compilation at link
time to emit the .llvm.call-graph-profile section to the compiled LTO
object file. Currently, it is being run only during the initial
LTO-prelink compilation stage (to produce the bitcode files to be
consumed by the linker) and so the section is not produced.

ThinLTO is not affected because:
- For ThinLTO-prelink compilation the CGProfilePass pass is not run
  because ThinLTO-prelink passes are added via
  buildThinLTOPreLinkDefaultPipeline. Normal and FullLTO-prelink
  passes are both added via buildPerModuleDefaultPipeline which uses
  the LTOPreLink parameter to customize its behavior for the
  FullLTO-prelink pass differences.
- ThinLTO backend compilation phase adds the CGProfilePass (see:
  buildModuleOptimizationPipeline).

Adjust when the pass is run so that the .llvm.call-graph-profile
section is produced correctly for FullLTO.

Fixes #56185 (https://github.com/llvm/llvm-project/issues/56185)
2022-07-01 13:57:36 +01:00
..
CMakeLists.txt [NFC] Split up PassBuilder.cpp 2021-09-15 15:30:39 -07:00
OptimizationLevel.cpp [NFC] Split up PassBuilder.cpp 2021-09-15 15:30:39 -07:00
PassBuilder.cpp Revert "[Coroutines] Only do symmetric transfer if optimization is on" 2022-06-27 10:54:56 +08:00
PassBuilderBindings.cpp [Coroutines] Run coroutine passes by default 2021-07-15 14:33:40 +08:00
PassBuilderPipelines.cpp [LLVM][LTO][LLD] Enable Profile Guided Layout (--call-graph-profile-sort) for FullLTO 2022-07-01 13:57:36 +01:00
PassPlugin.cpp [NPM] Resolve llvmGetPassPluginInfo to the plugin being loaded 2021-06-30 18:11:28 +01:00
PassRegistry.def Delete 'llvm.asan.globals' for global metadata. 2022-06-27 14:40:40 -07:00
StandardInstrumentations.cpp StandardInstrumentation: print verifier output to errs 2022-06-29 12:11:55 +02:00