[TargetLowering] Use SelectionDAG::getSetCC and remove a repeated call to getSetCCRes...
authorCraig Topper <craig.topper@intel.com>
Fri, 10 Jan 2020 21:11:14 +0000 (13:11 -0800)
committerCraig Topper <craig.topper@intel.com>
Fri, 10 Jan 2020 21:24:00 +0000 (13:24 -0800)
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

index 20e794b..329d101 100644 (file)
@@ -415,18 +415,14 @@ void TargetLowering::softenSetCCOperands(SelectionDAG &DAG, EVT VT,
     // Update Chain.
     Chain = Call.second;
   } else {
-    SDValue Tmp = DAG.getNode(
-        ISD::SETCC, dl,
-        getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), RetVT),
-        NewLHS, NewRHS, DAG.getCondCode(CCCode));
+    EVT SetCCVT =
+        getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), RetVT);
+    SDValue Tmp = DAG.getSetCC(dl, SetCCVT, NewLHS, NewRHS, CCCode);
     auto Call2 = makeLibCall(DAG, LC2, RetVT, Ops, CallOptions, dl, Chain);
     CCCode = getCmpLibcallCC(LC2);
     if (ShouldInvertCC)
       CCCode = getSetCCInverse(CCCode, RetVT);
-    NewLHS = DAG.getNode(
-        ISD::SETCC, dl,
-        getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), RetVT),
-        Call2.first, NewRHS, DAG.getCondCode(CCCode));
+    NewLHS = DAG.getSetCC(dl, SetCCVT, Call2.first, NewRHS, CCCode);
     if (Chain)
       Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Call.second,
                           Call2.second);