diff options
author | Bob Wilson <bob.wilson@apple.com> | 2012-04-30 16:53:34 +0000 |
---|---|---|
committer | Bob Wilson <bob.wilson@apple.com> | 2012-04-30 16:53:34 +0000 |
commit | 9245c936566d119c908cabdca16cd31b93da3ca3 (patch) | |
tree | 016ba7369213804d1b34a30d37a775a84d541389 /llvm/lib/Target/ARM/ARMISelLowering.cpp | |
parent | d5ead14365402730ba89af3e7a312487e96f8eee (diff) | |
download | bcm5719-llvm-9245c936566d119c908cabdca16cd31b93da3ca3.tar.gz bcm5719-llvm-9245c936566d119c908cabdca16cd31b93da3ca3.zip |
Don't introduce illegal types when creating vmull operations. <rdar://11324364>
ARM BUILD_VECTORs created after type legalization cannot use i8 or i16
operands, since those types are not legal. Instead use i32 operands, which
will be implicitly truncated by the BUILD_VECTOR to match the element type.
llvm-svn: 155824
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 e193672ef7a..88da2632d79 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -4792,7 +4792,9 @@ static SDValue SkipExtension(SDNode *N, SelectionDAG &DAG) { for (unsigned i = 0; i != NumElts; ++i) { ConstantSDNode *C = cast<ConstantSDNode>(N->getOperand(i)); const APInt &CInt = C->getAPIntValue(); - Ops.push_back(DAG.getConstant(CInt.trunc(EltSize), TruncVT)); + // Element types smaller than 32 bits are not legal, so use i32 elements. + // The values are implicitly truncated so sext vs. zext doesn't matter. + Ops.push_back(DAG.getConstant(CInt.zextOrTrunc(32), MVT::i32)); } return DAG.getNode(ISD::BUILD_VECTOR, N->getDebugLoc(), MVT::getVectorVT(TruncVT, NumElts), Ops.data(), NumElts); |