about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-01 08:22:18 +0000
committerbors <bors@rust-lang.org>2025-03-01 08:22:18 +0000
commitf56e516575f67e05720614fb9fc1b1e8870c970c (patch)
tree153c9e1cf74bada43deb0be7ca1d7803796c5806 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent309d6b0375fb7e092ba63d3c291610002c60a4a2 (diff)
parent016f429c56992f2d62717fe2b6554ca4c4dd1f4a (diff)
downloadrust-f56e516575f67e05720614fb9fc1b1e8870c970c.tar.gz
rust-f56e516575f67e05720614fb9fc1b1e8870c970c.zip
Auto merge of #133250 - DianQK:embed-bitcode-pgo, r=nikic
The embedded bitcode should always be prepared for LTO/ThinLTO

Fixes #115344. Fixes #117220.

There are currently two methods for generating bitcode that used for LTO. One method involves using `-C linker-plugin-lto` to emit object files as bitcode, which is the typical setting used by cargo. The other method is through `-C embed-bitcode=yes`.

When using with `-C embed-bitcode=yes -C lto=no`, we run a complete non-LTO LLVM pipeline to obtain bitcode, then the bitcode is used for LTO. We run the Call Graph Profile Pass twice on the same module.

This PR is doing something similar to LLVM's `buildFatLTODefaultPipeline`, obtaining the bitcode for embedding after running `buildThinLTOPreLinkDefaultPipeline`.

r? nikic
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions