Skip to content

Commit 1bf271d

Browse files
authored
Revert "[ThinLTO] Do not duplicate import a function that is actually defined in the current module" (#111919)
Reverts #110064
1 parent c686eeb commit 1bf271d

File tree

3 files changed

+1
-121
lines changed

3 files changed

+1
-121
lines changed

llvm/lib/Linker/IRMover.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,15 +595,11 @@ Value *IRLinker::materialize(Value *V, bool ForIndirectSymbol) {
595595
if (!SGV)
596596
return nullptr;
597597

598-
// If SGV is from dest, it was already materialized when dest was loaded.
599-
if (SGV->getParent() == &DstM)
600-
return nullptr;
601-
602598
// When linking a global from other modules than source & dest, skip
603599
// materializing it because it would be mapped later when its containing
604600
// module is linked. Linking it now would potentially pull in many types that
605601
// may not be mapped properly.
606-
if (SGV->getParent() != SrcM.get())
602+
if (SGV->getParent() != &DstM && SGV->getParent() != SrcM.get())
607603
return nullptr;
608604

609605
Expected<Constant *> NewProto = linkGlobalValueProto(SGV, ForIndirectSymbol);

llvm/test/ThinLTO/X86/Inputs/ditemplatevalueparameter-remap.ll

Lines changed: 0 additions & 29 deletions
This file was deleted.

llvm/test/ThinLTO/X86/ditemplatevalueparameter-remap.ll

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)