OSDN Git Service

[GlobalMerge] Use private linkage for MergedGlobals variables
authorJohn Brawn <john.brawn@arm.com>
Tue, 11 Aug 2015 15:48:04 +0000 (15:48 +0000)
committerJohn Brawn <john.brawn@arm.com>
Tue, 11 Aug 2015 15:48:04 +0000 (15:48 +0000)
commit67404cfbc08b45c7d245319c8738fdc8717c0c41
treebdea36595ea6956c1ec3760261b8a7dd1bca0026
parentd50888216bbeeaa50dee1021e353822844a12835
[GlobalMerge] Use private linkage for MergedGlobals variables

Other objects can never reference the MergedGlobals symbol so external linkage
is never needed. Using private instead of internal linkage means the object is
more similar to what it looks like when global merging is not enabled, with
the only difference being that the merged variables are addressed indirectly
relative to the start of the section they are in.

Also add aliases for merged variables with internal linkage, as this also makes
the object be more like what it is when they are not merged.

Differential Revision: http://reviews.llvm.org/D11942

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244615 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/GlobalMerge.cpp
test/CodeGen/AArch64/global-merge-1.ll
test/CodeGen/AArch64/global-merge-2.ll
test/CodeGen/AArch64/global-merge-3.ll
test/CodeGen/AArch64/global-merge-4.ll
test/CodeGen/AArch64/global-merge-group-by-use.ll
test/CodeGen/AArch64/global-merge-ignore-single-use-minsize.ll
test/CodeGen/AArch64/global-merge-ignore-single-use.ll
test/CodeGen/ARM/2011-06-29-MergeGlobalsAlign.ll
test/CodeGen/ARM/global-merge-1.ll
test/CodeGen/ARM/global-merge-external.ll