[PATCH] D66814: [IRMover] Don't map globals if their types are the same
Pirama Arumuga Nainar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 27 14:28:44 PDT 2019
pirama added inline comments.
================
Comment at: llvm/lib/Linker/IRMover.cpp:765
+ // is from the source module and got added to DstM from a module
+ // summary. We shouldn't map this type to itself in case the type's
+ // components get remapped to a new type from DstM (for instance, during
----------------
tejohnson wrote:
> Can you confirm how the DGV was added to the DstM originally? Do you mean it was already imported from SGV based on information in the summary? We don't directly add from the module summary, it is just used to compute the list of GVs to import from a source here via the IRMover.
Yes, even without this change, DGV was added to DstM.
Here's the path that I traced inside a debugger:
Inputs/type-mapping-bug3.ll: function 'a' has attached debug metadata !6
Parsing that metadata ends up at metadata !5 (which is shared between both input files)
In type-mapping-bug3.ll, processing !5 leads to !7 which is a ConstantAsMetadata, with value as the function declaration.
This value/declaration gets added to DstM in Mapper::mapSimpleMetadata in ValueMapper.cpp.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D66814/new/
https://reviews.llvm.org/D66814
More information about the llvm-commits
mailing list