diff options
author | Quentin Colombet <qcolombet@apple.com> | 2013-07-23 22:34:47 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2013-07-23 22:34:47 +0000 |
commit | 0f2fe74aaf47925fd1cb7aa1329244ab550096fc (patch) | |
tree | 2ce464a23a8317f19d06fcd354c036e8cb9143f1 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | 402ccb5d6676599ac15a4505f0e7fa910398ce40 (diff) | |
download | bcm5719-llvm-0f2fe74aaf47925fd1cb7aa1329244ab550096fc.tar.gz bcm5719-llvm-0f2fe74aaf47925fd1cb7aa1329244ab550096fc.zip |
[ARM][ISel] Improve the lowering of vector loads.
When vectors are built from a single value, the ARM lowering issues a
scalar_to_vector node.
This node is then always morphed into a move from the general purpose unit to
the vector unit.
When the value comes from a load, this can be simplified into a vector load to
the right lane.
This patch changes the lowering of insert_vector_elt to expose a vector
friendly pattern in this situation.
This is a step toward fixing <rdar://problem/14170854>.
llvm-svn: 186999
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 569beadc60e..ea13c88be82 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -4674,7 +4674,9 @@ SDValue ARMTargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG, if (ValueCounts.size() == 0) return DAG.getUNDEF(VT); - if (isOnlyLowElement) + // Loads are better lowered with insert_vector_elt/ARMISD::BUILD_VECTOR. + // Keep going if we are hitting this case. + if (isOnlyLowElement && !ISD::isNormalLoad(Value.getNode())) return DAG.getNode(ISD::SCALAR_TO_VECTOR, dl, VT, Value); unsigned EltSize = VT.getVectorElementType().getSizeInBits(); |