From: Craig Topper Date: Wed, 2 Oct 2019 22:34:49 +0000 (+0000) Subject: [LegalizeTypes] Check for already split condition before calilng SplitVecRes_SETCC... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c73599fde257ea8edd289a45919b290b0a396614;p=llvm [LegalizeTypes] Check for already split condition before calilng SplitVecRes_SETCC in SplitRes_SELECT. No point in manually splitting the SETCC if it was already done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373535 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp index eadc388fc9d..560b5729e3d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp @@ -514,15 +514,15 @@ void DAGTypeLegalizer::SplitRes_SELECT(SDNode *N, SDValue &Lo, SDValue &Hi) { if (Cond.getValueType().isVector()) { if (SDValue Res = WidenVSELECTAndMask(N)) std::tie(CL, CH) = DAG.SplitVector(Res->getOperand(0), dl); - // It seems to improve code to generate two narrow SETCCs as opposed to - // splitting a wide result vector. - else if (Cond.getOpcode() == ISD::SETCC) - SplitVecRes_SETCC(Cond.getNode(), CL, CH); // Check if there are already splitted versions of the vector available and // use those instead of splitting the mask operand again. else if (getTypeAction(Cond.getValueType()) == TargetLowering::TypeSplitVector) GetSplitVector(Cond, CL, CH); + // It seems to improve code to generate two narrow SETCCs as opposed to + // splitting a wide result vector. + else if (Cond.getOpcode() == ISD::SETCC) + SplitVecRes_SETCC(Cond.getNode(), CL, CH); else std::tie(CL, CH) = DAG.SplitVector(Cond, dl); }