[IR] Add missing GlobalAlias copying of ThreadLocalMode attribute
authorItay Bookstein <itay.bookstein@nextsilicon.com>
Tue, 16 Jun 2020 23:17:27 +0000 (16:17 -0700)
committerTeresa Johnson <tejohnson@google.com>
Wed, 17 Jun 2020 03:15:27 +0000 (20:15 -0700)
commitdf9d64ed9c1d819bc0a040e3ef4c4a4003bf5c93
treed5ae704412557bc5c9c9525f6555488b1b298230
parent3b34f3fccac93697065df620d454fcadceb4fa6e
[IR] Add missing GlobalAlias copying of ThreadLocalMode attribute

Summary:
Previously, GlobalAlias::copyAttributesFrom did not preserve ThreadLocalMode,
causing incorrect IR generation in IR linking flows. This patch pushes the code
responsible for copying this attribute from GlobalVariable::copyAttributesFrom
down to GlobalValue::copyAttributesFrom so that it is shared by GlobalAlias.
Fixes PR46297.

Reviewers: tejohnson, pcc, hans

Reviewed By: tejohnson, hans

Subscribers: hiraditya, ibookstein, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81605
llvm/lib/IR/Globals.cpp
llvm/test/Linker/Inputs/alias-threadlocal-defs.ll [new file with mode: 0644]
llvm/test/Linker/alias-threadlocal.ll [new file with mode: 0644]