Skip to content

Commit

Permalink
Revert "[ThinLTO] Do not duplicate import a function that is actually…
Browse files Browse the repository at this point in the history
… defined in the current module" (llvm#111919)

Reverts llvm#110064
  • Loading branch information
huangjd authored and bricknerb committed Oct 17, 2024
1 parent 6bcf448 commit da51a2f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 121 deletions.
6 changes: 1 addition & 5 deletions llvm/lib/Linker/IRMover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,15 +595,11 @@ Value *IRLinker::materialize(Value *V, bool ForIndirectSymbol) {
if (!SGV)
return nullptr;

// If SGV is from dest, it was already materialized when dest was loaded.
if (SGV->getParent() == &DstM)
return nullptr;

// When linking a global from other modules than source & dest, skip
// materializing it because it would be mapped later when its containing
// module is linked. Linking it now would potentially pull in many types that
// may not be mapped properly.
if (SGV->getParent() != SrcM.get())
if (SGV->getParent() != &DstM && SGV->getParent() != SrcM.get())
return nullptr;

Expected<Constant *> NewProto = linkGlobalValueProto(SGV, ForIndirectSymbol);
Expand Down
29 changes: 0 additions & 29 deletions llvm/test/ThinLTO/X86/Inputs/ditemplatevalueparameter-remap.ll

This file was deleted.

87 changes: 0 additions & 87 deletions llvm/test/ThinLTO/X86/ditemplatevalueparameter-remap.ll

This file was deleted.

0 comments on commit da51a2f

Please sign in to comment.