[DAGCombiner] SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(V,C)) -> VECTOR_SHUFFLE
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 7 Mar 2015 05:52:42 +0000 (05:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sat, 7 Mar 2015 05:52:42 +0000 (05:52 +0000)
commitbede80a4401162f130825d0b06a37027066f68b0
tree49faaed285a3de1d255bf54bd7dfe365285081d1
parent58f8cc15c96c35789c4b50f182808a34b0ce4eb5
[DAGCombiner] SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(V,C)) -> VECTOR_SHUFFLE

This patch attempts to convert a SCALAR_TO_VECTOR using an operand from an EXTRACT_VECTOR_ELT into a VECTOR_SHUFFLE.

This prevents many cases of spilling scalar data between the gpr + simd registers.

At present the optimization only accepts cases where there is no TRUNC of the scalar type (i.e. all types must match).

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

llvm-svn: 231554
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/mmx-arg-passing-x86-64.ll
llvm/test/CodeGen/X86/pr14161.ll