[CodeGen] Combine concat_vectors of scalars into build_vector.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 13 Apr 2015 22:57:21 +0000 (22:57 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Mon, 13 Apr 2015 22:57:21 +0000 (22:57 +0000)
commit164cbefb855dfdecd28de55314eb27e820946b0d
treea494c8e9128a63cf3521d474c6f3e109dd77b572
parent8bdb7dbe57193057941aad79bb57c09a6df2e004
[CodeGen] Combine concat_vectors of scalars into build_vector.

Combine something like:
  (v8i8 concat_vectors (v2i8 bitcast (i16)) x4)
into:
  (v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4)))

If any of the scalars are floating point, use that throughout.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234809 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/AArch64/concat_vector-scalar-combine.ll [new file with mode: 0644]