]> granicus.if.org Git - llvm/commitdiff
[SelectionDAG] Simplify some calls to getSetCCResultType. NFC
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 9 Jul 2019 10:27:51 +0000 (10:27 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Tue, 9 Jul 2019 10:27:51 +0000 (10:27 +0000)
DAGTypeLegalizer and SelectionDAGLegalize has helper
functions wrapping the call to TLI.getSetCCResultType(...).
Use those helpers in more places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365456 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

index 1ef90445994a0c4ffc79375ce9dc888c32ddbbc9..bf817f00f83da29e09687a213d33a89e768c97f8 100644 (file)
@@ -3573,8 +3573,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
       assert(!TLI.isOperationExpand(ISD::SELECT, VT) &&
              "Cannot expand ISD::SELECT_CC when ISD::SELECT also needs to be "
              "expanded.");
-      EVT CCVT =
-          TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), CmpVT);
+      EVT CCVT = getSetCCResultType(CmpVT);
       SDValue Cond = DAG.getNode(ISD::SETCC, dl, CCVT, Tmp1, Tmp2, CC, Node->getFlags());
       Results.push_back(DAG.getSelect(dl, VT, Cond, Tmp3, Tmp4));
       break;
index d49bb896146c9f007880a3f0bc710c27288d8324..15ac45c37c667734ee3b1d053dbc823a5cba26e9 100644 (file)
@@ -2778,8 +2778,7 @@ void DAGTypeLegalizer::ExpandIntRes_MULFIX(SDNode *N, SDValue &Lo,
   SDValue RHS = N->getOperand(1);
   uint64_t Scale = N->getConstantOperandVal(2);
   bool Saturating = N->getOpcode() == ISD::SMULFIXSAT;
-  EVT BoolVT =
-      TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), VT);
+  EVT BoolVT = getSetCCResultType(VT);
   SDValue Zero = DAG.getConstant(0, dl, VT);
   if (!Scale) {
     SDValue Result;
@@ -2832,8 +2831,7 @@ void DAGTypeLegalizer::ExpandIntRes_MULFIX(SDNode *N, SDValue &Lo,
   SDValue SatMax, SatMin;
   SDValue NVTZero = DAG.getConstant(0, dl, NVT);
   SDValue NVTNeg1 = DAG.getConstant(-1, dl, NVT);
-  EVT BoolNVT =
-      TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(), NVT);
+  EVT BoolNVT = getSetCCResultType(NVT);
 
   // After getting the multplication result in 4 parts, we need to perform a
   // shift right by the amount of the scale to get the result in that scale.
index a4a80c07c2e933bdfa6ee37a377ae81a34a96bd3..7e4d52617977a4ea342b32f4b5c9c60b8b7a3e79 100644 (file)
@@ -4487,8 +4487,7 @@ SDValue DAGTypeLegalizer::WidenVecOp_SETCC(SDNode *N) {
 
   // Get a new SETCC node to compare the newly widened operands.
   // Only some of the compared elements are legal.
-  EVT SVT = TLI.getSetCCResultType(DAG.getDataLayout(), *DAG.getContext(),
-                                   InOp0.getValueType());
+  EVT SVT = getSetCCResultType(InOp0.getValueType());
   // The result type is legal, if its vXi1, keep vXi1 for the new SETCC.
   if (VT.getScalarType() == MVT::i1)
     SVT = EVT::getVectorVT(*DAG.getContext(), MVT::i1,