summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-08-29 15:34:58 +0000
committerTim Northover <tnorthover@apple.com>2014-08-29 15:34:58 +0000
commit3c0915e85813c2e40e20dac884d4283d44a42be4 (patch)
tree92e8af3fd26d4d589befe3075550df04b764d810 /llvm/lib/Target
parentaaae87e5ab3b1a48ae380496a2760f068ed0fa46 (diff)
downloadbcm5719-llvm-3c0915e85813c2e40e20dac884d4283d44a42be4.tar.gz
bcm5719-llvm-3c0915e85813c2e40e20dac884d4283d44a42be4.zip
AArch64: only try to get operand of a known node.
A bug in r216725 meant we tried to discover the type of a SETCC before confirming the node actually was a SETCC. llvm-svn: 216734
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64ISelLowering.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 430938e2f43..5ccc4bf9ff4 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -7994,18 +7994,18 @@ static SDValue performVSelectCombine(SDNode *N, SelectionDAG &DAG) {
static SDValue performSelectCombine(SDNode *N, SelectionDAG &DAG) {
SDValue N0 = N->getOperand(0);
EVT ResVT = N->getValueType(0);
- EVT SrcVT = N0.getOperand(0).getValueType();
- int NumMaskElts = ResVT.getSizeInBits() / SrcVT.getSizeInBits();
+
+ if (N0.getOpcode() != ISD::SETCC || N0.getValueType() != MVT::i1)
+ return SDValue();
// If NumMaskElts == 0, the comparison is larger than select result. The
// largest real NEON comparison is 64-bits per lane, which means the result is
// at most 32-bits and an illegal vector. Just bail out for now.
+ EVT SrcVT = N0.getOperand(0).getValueType();
+ int NumMaskElts = ResVT.getSizeInBits() / SrcVT.getSizeInBits();
if (!ResVT.isVector() || NumMaskElts == 0)
return SDValue();
- if (N0.getOpcode() != ISD::SETCC || N0.getValueType() != MVT::i1)
- return SDValue();
-
SrcVT = EVT::getVectorVT(*DAG.getContext(), SrcVT, NumMaskElts);
EVT CCVT = SrcVT.changeVectorElementTypeToInteger();
OpenPOWER on IntegriCloud