[ARM] Improve the instruction selection of vector loads.
authorQuentin Colombet <qcolombet@apple.com>
Wed, 3 Jul 2013 21:42:57 +0000 (21:42 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Wed, 3 Jul 2013 21:42:57 +0000 (21:42 +0000)
commit8e2e5ff0240dfb90c6dbc93e7fc441f71bfde400
treeb163dc6520c3868d02e04e8787c0145293a1a5cd
parent4e976457eb2e777dcd515a7b82e62161552a2466
[ARM] Improve the instruction selection of vector loads.

In the ARM back-end, build_vector nodes are lowered to a target specific
build_vector that uses floating point type.
This works well, unless the inserted bitcasts survive until instruction
selection. In that case, they incur moves between integer unit and floating
point unit that may result in inefficient code.

In other words, this conversion may introduce artificial dependencies when the
code leading to the build vector cannot be completed with a floating point type.

In particular, this happens when loads are not aligned.

Before this patch, in that case, the compiler generates general purpose loads
and creates the floating point vector from them, instead of directly using the
vector unit.

The patch uses a vector friendly sequence of code when the inserted bitcasts to
floating point survived DAGCombine.

This is done by a target specific DAGCombine that changes the target specific
build_vector into a sequence of insert_vector_elt that get rid of the bitcasts.

<rdar://problem/14170854>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185587 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/2012-05-04-vmov.ll
test/CodeGen/ARM/vector-DAGCombine.ll