merge vector stores into wider vector stores and fix AArch64 misaligned access TLI...
authorSanjay Patel <spatel@rotateright.com>
Fri, 25 Sep 2015 21:49:48 +0000 (21:49 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 25 Sep 2015 21:49:48 +0000 (21:49 +0000)
commitf77610018fc75515ea893e38637f1f80d5534cb0
treef8f121de91aed2bd210a58e1e0bc5d33ca7b350d
parent7aa5b69c4a7ec1b2c06f60fd0b47a34122b8cf09
merge vector stores into wider vector stores and fix AArch64 misaligned access TLI hook (PR21711)

This is a redo of D7208 ( r227242 - http://llvm.org/viewvc/llvm-project?view=revision&revision=227242 ).

The patch was reverted because an AArch64 target could infinite loop after the change in DAGCombiner
to merge vector stores. That happened because AArch64's allowsMisalignedMemoryAccesses() wasn't telling
the truth. It reported all unaligned memory accesses as fast, but then split some 128-bit unaligned
accesses up in performSTORECombine() because they are slow.

This patch attempts to fix the problem in AArch's allowsMisalignedMemoryAccesses() while preserving
existing (perhaps questionable) lowering behavior.

The x86 test shows that store merging is working as intended for a target with fast 32-byte unaligned
stores.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248622 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/merge-store.ll
test/CodeGen/X86/MergeConsecutiveStores.ll