From 230fbef32d4dce0c48d2dc1c077b89609fb645eb Mon Sep 17 00:00:00 2001 From: Bjorn Pettersson Date: Tue, 9 Jul 2019 10:27:51 +0000 Subject: [PATCH] [SelectionDAG] Simplify some calls to getSetCCResultType. NFC 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 | 3 +-- lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 6 ++---- lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 1ef90445994..bf817f00f83 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -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; diff --git a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index d49bb896146..15ac45c37c6 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -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. diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index a4a80c07c2e..7e4d5261797 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -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, -- 2.40.0