Fix alignment checks in MergeConsecutiveStores.
authorJames Y Knight <jyknight@google.com>
Fri, 8 May 2015 13:47:01 +0000 (13:47 +0000)
committerJames Y Knight <jyknight@google.com>
Fri, 8 May 2015 13:47:01 +0000 (13:47 +0000)
commite9359f427ecda293d8b0d751b4b852d96446d674
treec039473e3d8f066e1b30f543e070cc6072c7292b
parent4650d0e792234dd31edbe2298511ad67864a7dc6
Fix alignment checks in MergeConsecutiveStores.

1) check whether the alignment of the memory is sufficient for the
*merged* store or load to be efficient.

Not doing so can result in some ridiculously poor code generation, if
merging creates a vector operation which must be aligned but isn't.

2) DON'T check that the alignment of each load/store is equal. If
you're merging 2 4-byte stores, the first *might* have 8-byte
alignment, but the second certainly will have 4-byte alignment. We do
want to allow those to be merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236850 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/PowerPC/MergeConsecutiveStores.ll [new file with mode: 0644]
test/CodeGen/X86/MergeConsecutiveStores.ll