Commit a7857d6c authored by Pirama Arumuga Nainar's avatar Pirama Arumuga Nainar Committed by Nick Desaulniers
Browse files

[UPSTREAM][IRMover] Don't map globals if their types are the same

Summary:
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 shared metadata.

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.

Reviewers: tejohnson, pcc, srhines

Subscribers: mehdi_amini, hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66814

llvm-svn: 371643
(cherry picked from commit 8b465446)

Change-Id: I647542eefa51e0cf8f5dc9e187f3f7f8f9cf0130
parent 976c0416
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment