[GlobalMerge] Set the alignment on merged global structs
authorDavid Green <david.green@arm.com>
Wed, 6 Jun 2018 14:48:32 +0000 (14:48 +0000)
committerDavid Green <david.green@arm.com>
Wed, 6 Jun 2018 14:48:32 +0000 (14:48 +0000)
commit25312b2b6c945e1cd236dc679b174114d96d840e
treededf999be925a52b616746b4f929a61e25c9e247
parent566c74cc9850f421f54f4790d996517cb8a52b03
[GlobalMerge] Set the alignment on merged global structs

If no alignment is set, the abi/preferred alignment of structs will be
used which may be higher than required. This can lead to extra padding
and in the end an increase in data size.

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

llvm-svn: 334099
llvm/lib/CodeGen/GlobalMerge.cpp
llvm/test/CodeGen/AArch64/global-merge-1.ll
llvm/test/CodeGen/AArch64/global-merge-2.ll
llvm/test/CodeGen/AArch64/global-merge-3.ll
llvm/test/CodeGen/AArch64/global-merge-4.ll
llvm/test/CodeGen/AArch64/global-merge-group-by-use.ll
llvm/test/CodeGen/AArch64/global-merge-ignore-single-use-minsize.ll
llvm/test/CodeGen/AArch64/global-merge-ignore-single-use.ll
llvm/test/CodeGen/ARM/global-merge-1.ll
llvm/test/CodeGen/ARM/global-merge-alignment.ll [new file with mode: 0644]
llvm/test/Transforms/GlobalMerge/debug-info.ll