[all-commits] [llvm/llvm-project] 6c3d84: [ThinLTO] Drop !inline_history metadata when impor...
Arthur Eubanks via All-commits
all-commits at lists.llvm.org
Fri Apr 17 12:47:19 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6c3d84cbdf987e3f2eb113fb4e9212c56b54c6b5
https://github.com/llvm/llvm-project/commit/6c3d84cbdf987e3f2eb113fb4e9212c56b54c6b5
Author: Arthur Eubanks <aeubanks at google.com>
Date: 2026-04-17 (Fri, 17 Apr 2026)
Changed paths:
M llvm/include/llvm/Transforms/Utils/ValueMapper.h
M llvm/lib/Linker/IRMover.cpp
M llvm/lib/Transforms/Utils/ValueMapper.cpp
A llvm/test/Transforms/FunctionImport/Inputs/inline-history.ll
A llvm/test/Transforms/FunctionImport/inline-history.ll
Log Message:
-----------
[ThinLTO] Drop !inline_history metadata when importing functions (#192564)
In #190876 we now have functions in ValueAsMetadata (!inline_history
metadata). This has caused undefined symbol linker errors in some
ThinLTO builds. The following is what's going on:
@f in module A is getting imported from module A to module B, and it has
a call with !inline_history pointing to @g in module A, so a declaration
for @g is also imported into module B. But @g gets internalized in
module A, causing the undefined symbol error at link time due to
memprof's ICP in module B creating a call to @g since we can ICP a call
to any declaration.
To avoid pulling in a function declaration that may be wrong, simply
drop !inline_history metadata when importing functions. They aren't
necessary for correctness, they only prevent inlining explosion in some
recursive edge cases. Worst case is we do another round of inlining
through mutually recursive functions and then stop again due to newly
added !inline_history metadata, which should be fine; the inlining
explosion typically happens because we keep inlining through mutually
recursive functions.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list