[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)
commit04b3a0fdb254498811d4c83a66619f80d63ba07d
tree95225a957523f9dbe70cc88d4d6ea02cb6ba74d1
parent270a12cff371eb1d5e69ae3e325afe3471ada670
[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>

llvm-svn: 185587
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/2012-05-04-vmov.ll
llvm/test/CodeGen/ARM/vector-DAGCombine.ll