[llvm] r355847 - [DAG] FoldSetCC - reuse valuetype + ensure its simple.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 10:56:18 PDT 2019
Author: rksimon
Date: Mon Mar 11 10:56:18 2019
New Revision: 355847
URL: http://llvm.org/viewvc/llvm-project?rev=355847&view=rev
Log:
[DAG] FoldSetCC - reuse valuetype + ensure its simple.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=355847&r1=355846&r2=355847&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Mon Mar 11 10:56:18 2019
@@ -1970,7 +1970,7 @@ SDValue SelectionDAG::FoldSetCC(EVT VT,
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,
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()) {
More information about the llvm-commits
mailing list