Skip to content

Revert "[ThinLTO] Do not duplicate import a function that is actually defined in the current module" #111919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading