[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)
commit62ba058dea475a454a617295d3f63fb4a5f585b3
treef10d4a90caf32b518c7152efdeb6da1e4c163eb5
parentb0b21de6278b967e302d44954d8d9f6235d233be
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231554 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/mmx-arg-passing-x86-64.ll
test/CodeGen/X86/pr14161.ll