about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2025-07-31 13:12:45 +0200
committerGitHub <noreply@github.com>2025-07-31 13:12:45 +0200
commitd8c09c10e5e86559cd49e1081482d2b700ba5ccf (patch)
treed42f502c7e5c9b4f7cac82f1017e774ca0cc1824 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parentcc0a5b73053c62a3df5f84b3ee85079c9b65fa87 (diff)
parent7a127fba657ed627cc4877f2871abaf7d9819caa (diff)
downloadrust-d8c09c10e5e86559cd49e1081482d2b700ba5ccf.tar.gz
rust-d8c09c10e5e86559cd49e1081482d2b700ba5ccf.zip
Rollup merge of #136840 - Flakebi:linker-plugin-lto-fat, r=dianqk
Fix linker-plugin-lto only doing thin lto

When rust provides LLVM bitcode files to lld and the bitcode contains
function summaries as used for thin lto, lld defaults to using thin lto.
This prevents some optimizations that are only applied for fat lto.

We solve this by not creating function summaries when fat lto is
enabled. The bitcode for the module is just directly written out.

An alternative solution would be to set the `ThinLTO=0` module flag to
signal lld to do fat lto.
The code in clang that sets this flag is here:
https://github.com/llvm/llvm-project/blob/560149b5e3c891c64899e9912e29467a69dc3a4c/clang/lib/CodeGen/BackendUtil.cpp#L1150
The code in LLVM that queries the flag and defaults to thin lto if not
set is here:
https://github.com/llvm/llvm-project/blob/e258bca9505f35e0a22cb213a305eea9b76d11ea/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L4441-L4446

try-job: x86_64-gnu-debug
try-job: aarch64-gnu-debug
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions