Implement global merge optimization for global variables.
authorJiangning Liu <jiangning.liu@arm.com>
Thu, 15 May 2014 23:45:42 +0000 (23:45 +0000)
committerJiangning Liu <jiangning.liu@arm.com>
Thu, 15 May 2014 23:45:42 +0000 (23:45 +0000)
commitd5db8765d61ca77a55867cf1f39aecb8cae3a6cd
treefd12d05d5eac5450fa954c2aee66443a36a82df2
parent01a02d91dcb47cdc31fe6570f59eac3740d3da0e
Implement global merge optimization for global variables.

This commit implements two command line switches -global-merge-on-external
and -global-merge-aligned, and both of them are false by default, so this
optimization is disabled by default for all targets.

For ARM64, some back-end behaviors need to be tuned to get this optimization
further enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208934 91177308-0d34-0410-b5e6-96231b3b80d8
20 files changed:
include/llvm/IR/GlobalAlias.h
include/llvm/Target/TargetLowering.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/IR/Globals.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Target/ARM64/ARM64ISelLowering.cpp
lib/Target/ARM64/ARM64ISelLowering.h
lib/Transforms/Scalar/GlobalMerge.cpp
lib/Transforms/Scalar/Scalar.cpp
test/CodeGen/AArch64/global-merge.ll [new file with mode: 0644]
test/CodeGen/AArch64/global_merge_1.ll [deleted file]
test/CodeGen/ARM/global-merge-1.ll [new file with mode: 0644]
test/CodeGen/ARM64/global-merge.ll [new file with mode: 0644]
test/Transforms/GlobalMerge/AArch64/global-merge-1.ll [new file with mode: 0644]
test/Transforms/GlobalMerge/AArch64/global-merge-2.ll [new file with mode: 0644]
test/Transforms/GlobalMerge/AArch64/global-merge-3.ll [new file with mode: 0644]
test/Transforms/GlobalMerge/AArch64/lit.local.cfg [new file with mode: 0644]
test/Transforms/GlobalMerge/ARM/arm.ll
test/Transforms/GlobalMerge/ARM64/arm64.ll