summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-11 17:56:18 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-03-11 17:56:18 +0000
commitf3be93a2ff59836924eef83ed4a597bdf9bbc9a8 (patch)
tree2f4d1147b9df3b1134249c33fd28abfa1d91ecd2 /llvm/lib/CodeGen
parent4349dc76fa08d0d6dde47286f0b83a6f76729fe4 (diff)
downloadbcm5719-llvm-f3be93a2ff59836924eef83ed4a597bdf9bbc9a8.tar.gz
bcm5719-llvm-f3be93a2ff59836924eef83ed4a597bdf9bbc9a8.zip
[DAG] FoldSetCC - reuse valuetype + ensure its simple.
llvm-svn: 355847
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index d91d9d6b991..a87883bbe40 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -1970,7 +1970,7 @@ SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2,
case ISD::SETUO:
case ISD::SETUEQ:
case ISD::SETUNE:
- assert(!N1.getValueType().isInteger() && "Illegal setcc for integer!");
+ assert(!OpVT.isInteger() && "Illegal setcc for integer!");
break;
}
@@ -2054,11 +2054,10 @@ SDValue SelectionDAG::FoldSetCC(EVT VT, SDValue N1, SDValue N2,
case ISD::SETUGE: return getBoolConstant(R!=APFloat::cmpLessThan, dl, VT,
OpVT);
}
- } else if (N1CFP) {
+ } else if (N1CFP && OpVT.isSimple()) {
// Ensure that the constant occurs on the RHS.
ISD::CondCode SwappedCond = ISD::getSetCCSwappedOperands(Cond);
- MVT CompVT = N1.getValueType().getSimpleVT();
- if (!TLI->isCondCodeLegal(SwappedCond, CompVT))
+ if (!TLI->isCondCodeLegal(SwappedCond, OpVT.getSimpleVT()))
return SDValue();
return getSetCC(dl, VT, N2, N1, SwappedCond);
} else if (N2CFP && N2CFP->getValueAPF().isNaN()) {
OpenPOWER on IntegriCloud