[clang] [lld] [llvm] [LTO][LLD] Prevent invalid LTO libfunc transforms (PR #164916)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 10 03:22:41 PST 2025
================
@@ -2701,15 +2701,30 @@ static void markBuffersAsDontNeed(Ctx &ctx, bool skipLinkedOutput) {
template <class ELFT>
void LinkerDriver::compileBitcodeFiles(bool skipLinkedOutput) {
llvm::TimeTraceScope timeScope("LTO");
+ // Capture the triple before moving the bitcode into the bitcode compiler.
----------------
smithp35 wrote:
We are making an assumption that the triple is homogenous (modulo libcall differences) across all the bitcode files. Ideally this would be the case, but build systems being build systems there could be some differences, I'm thinking about normalised triples where `-march` might differ.
Looking at getLibFuncSymbols it seems like most if not all the variation in libcall availability is in the environment and I wouldn't expect that to vary across the build system.
I don't think we need to change anything here, but could be worth stating our assumptions in a comment.
https://github.com/llvm/llvm-project/pull/164916
More information about the llvm-commits
mailing list