[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 11:16:00 PDT 2019


pirama created this revision.
pirama added reviewers: tejohnson, pcc, srhines.
Herald added subscribers: dexonsmith, steven_wu, hiraditya, mehdi_amini.
Herald added a project: LLVM.

During IR Linking, if the types of two globals in destination and source
modules are the same, it can only be because the global in the
destination module is originally from the source module and got added to
the destination module 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 the destination (for instance, during the
loop over SrcM->getIdentifiedStructTypes() further below in
IRLinker::computeTypeMapping()).

Fixes PR40312.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66814

Files:
  llvm/lib/Linker/IRMover.cpp
  llvm/test/LTO/X86/Inputs/type-mapping-bug3.ll
  llvm/test/LTO/X86/type-mapping-bug3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66814.217441.patch
Type: text/x-patch
Size: 3895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190827/3a92cf9b/attachment.bin>


More information about the llvm-commits mailing list