merge consecutive stores of extracted vector elements (PR21711)
authorSanjay Patel <spatel@rotateright.com>
Thu, 22 Jan 2015 18:21:26 +0000 (18:21 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 22 Jan 2015 18:21:26 +0000 (18:21 +0000)
commit05d5e213c46d7a69ac5bb5f8a0c1208d58a8547a
tree1d2819a64c7b2ec4123b2e14544d4677dc97579d
parent5196540da12cc87f180d3fff46c72121720624d5
merge consecutive stores of extracted vector elements (PR21711)

This is a 2nd try at the same optimization as http://reviews.llvm.org/D6698.
That patch was checked in at r224611, but reverted at r225031 because it
caused a failure outside of the regression tests.

The cause of the crash was not recognizing consecutive stores that have mixed
source values (loads and vector element extracts), so this patch adds a check
to bail out if any store value is not coming from a vector element extract.

This patch also refactors the shared logic of the constant source and vector
extracted elements source cases into a helper function.

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

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