mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-09 03:56:28 +00:00
Introduce getSelect usage and use more getSelectCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184012 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
85cc4d8402
commit
b05e4778f0
@ -4547,14 +4547,16 @@ SDValue DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
|
|||||||
NegOne, DAG.getConstant(0, VT),
|
NegOne, DAG.getConstant(0, VT),
|
||||||
cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
|
cast<CondCodeSDNode>(N0.getOperand(2))->get(), true);
|
||||||
if (SCC.getNode()) return SCC;
|
if (SCC.getNode()) return SCC;
|
||||||
if (!VT.isVector() && (!LegalOperations ||
|
if (!VT.isVector() &&
|
||||||
TLI.isOperationLegal(ISD::SETCC, getSetCCResultType(VT))))
|
(!LegalOperations ||
|
||||||
return DAG.getNode(ISD::SELECT, SDLoc(N), VT,
|
TLI.isOperationLegal(ISD::SETCC, getSetCCResultType(VT)))) {
|
||||||
DAG.getSetCC(SDLoc(N),
|
return DAG.getSelect(SDLoc(N), VT,
|
||||||
getSetCCResultType(VT),
|
DAG.getSetCC(SDLoc(N),
|
||||||
N0.getOperand(0), N0.getOperand(1),
|
getSetCCResultType(VT),
|
||||||
cast<CondCodeSDNode>(N0.getOperand(2))->get()),
|
N0.getOperand(0), N0.getOperand(1),
|
||||||
NegOne, DAG.getConstant(0, VT));
|
cast<CondCodeSDNode>(N0.getOperand(2))->get()),
|
||||||
|
NegOne, DAG.getConstant(0, VT));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// fold (sext x) -> (zext x) if the sign bit is known zero.
|
// fold (sext x) -> (zext x) if the sign bit is known zero.
|
||||||
@ -9605,8 +9607,8 @@ SDValue DAGCombiner::SimplifySelect(SDLoc DL, SDValue N0,
|
|||||||
SCC.getOperand(0), SCC.getOperand(1),
|
SCC.getOperand(0), SCC.getOperand(1),
|
||||||
SCC.getOperand(4));
|
SCC.getOperand(4));
|
||||||
AddToWorkList(SETCC.getNode());
|
AddToWorkList(SETCC.getNode());
|
||||||
return DAG.getNode(ISD::SELECT, SDLoc(SCC), SCC.getValueType(),
|
return DAG.getSelect(SDLoc(SCC), SCC.getValueType(),
|
||||||
SCC.getOperand(2), SCC.getOperand(3), SETCC);
|
SCC.getOperand(2), SCC.getOperand(3), SETCC);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SCC;
|
return SCC;
|
||||||
@ -9675,10 +9677,10 @@ bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDValue LHS,
|
|||||||
if (LLD->isPredecessorOf(RLD) ||
|
if (LLD->isPredecessorOf(RLD) ||
|
||||||
RLD->isPredecessorOf(LLD))
|
RLD->isPredecessorOf(LLD))
|
||||||
return false;
|
return false;
|
||||||
Addr = DAG.getNode(ISD::SELECT, SDLoc(TheSelect),
|
Addr = DAG.getSelect(SDLoc(TheSelect),
|
||||||
LLD->getBasePtr().getValueType(),
|
LLD->getBasePtr().getValueType(),
|
||||||
TheSelect->getOperand(0), LLD->getBasePtr(),
|
TheSelect->getOperand(0), LLD->getBasePtr(),
|
||||||
RLD->getBasePtr());
|
RLD->getBasePtr());
|
||||||
} else { // Otherwise SELECT_CC
|
} else { // Otherwise SELECT_CC
|
||||||
SDNode *CondLHS = TheSelect->getOperand(0).getNode();
|
SDNode *CondLHS = TheSelect->getOperand(0).getNode();
|
||||||
SDNode *CondRHS = TheSelect->getOperand(1).getNode();
|
SDNode *CondRHS = TheSelect->getOperand(1).getNode();
|
||||||
@ -9812,8 +9814,8 @@ SDValue DAGCombiner::SimplifySelectCC(SDLoc DL, SDValue N0, SDValue N1,
|
|||||||
getSetCCResultType(N0.getValueType()),
|
getSetCCResultType(N0.getValueType()),
|
||||||
N0, N1, CC);
|
N0, N1, CC);
|
||||||
AddToWorkList(Cond.getNode());
|
AddToWorkList(Cond.getNode());
|
||||||
SDValue CstOffset = DAG.getNode(ISD::SELECT, DL, Zero.getValueType(),
|
SDValue CstOffset = DAG.getSelect(DL, Zero.getValueType(),
|
||||||
Cond, One, Zero);
|
Cond, One, Zero);
|
||||||
AddToWorkList(CstOffset.getNode());
|
AddToWorkList(CstOffset.getNode());
|
||||||
CPIdx = DAG.getNode(ISD::ADD, DL, TLI.getPointerTy(), CPIdx,
|
CPIdx = DAG.getNode(ISD::ADD, DL, TLI.getPointerTy(), CPIdx,
|
||||||
CstOffset);
|
CstOffset);
|
||||||
|
@ -1553,9 +1553,9 @@ SDValue SelectionDAGLegalize::ExpandFCOPYSIGN(SDNode* Node) {
|
|||||||
SDValue AbsVal = DAG.getNode(ISD::FABS, dl, Tmp1.getValueType(), Tmp1);
|
SDValue AbsVal = DAG.getNode(ISD::FABS, dl, Tmp1.getValueType(), Tmp1);
|
||||||
// Select between the nabs and abs value based on the sign bit of
|
// Select between the nabs and abs value based on the sign bit of
|
||||||
// the input.
|
// the input.
|
||||||
return DAG.getNode(ISD::SELECT, dl, AbsVal.getValueType(), SignBit,
|
return DAG.getSelect(dl, AbsVal.getValueType(), SignBit,
|
||||||
DAG.getNode(ISD::FNEG, dl, AbsVal.getValueType(), AbsVal),
|
DAG.getNode(ISD::FNEG, dl, AbsVal.getValueType(), AbsVal),
|
||||||
AbsVal);
|
AbsVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectionDAGLegalize::ExpandDYNAMIC_STACKALLOC(SDNode* Node,
|
void SelectionDAGLegalize::ExpandDYNAMIC_STACKALLOC(SDNode* Node,
|
||||||
@ -2335,7 +2335,7 @@ SDValue SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned,
|
|||||||
//pseudo-op, or, even better, for whole-function isel.
|
//pseudo-op, or, even better, for whole-function isel.
|
||||||
SDValue SignBitTest = DAG.getSetCC(dl, getSetCCResultType(MVT::i64),
|
SDValue SignBitTest = DAG.getSetCC(dl, getSetCCResultType(MVT::i64),
|
||||||
Op0, DAG.getConstant(0, MVT::i64), ISD::SETLT);
|
Op0, DAG.getConstant(0, MVT::i64), ISD::SETLT);
|
||||||
return DAG.getNode(ISD::SELECT, dl, MVT::f32, SignBitTest, Slow, Fast);
|
return DAG.getSelect(dl, MVT::f32, SignBitTest, Slow, Fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, implement the fully general conversion.
|
// Otherwise, implement the fully general conversion.
|
||||||
@ -2348,11 +2348,11 @@ SDValue SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned,
|
|||||||
DAG.getConstant(UINT64_C(0x7ff), MVT::i64));
|
DAG.getConstant(UINT64_C(0x7ff), MVT::i64));
|
||||||
SDValue Ne = DAG.getSetCC(dl, getSetCCResultType(MVT::i64),
|
SDValue Ne = DAG.getSetCC(dl, getSetCCResultType(MVT::i64),
|
||||||
And2, DAG.getConstant(UINT64_C(0), MVT::i64), ISD::SETNE);
|
And2, DAG.getConstant(UINT64_C(0), MVT::i64), ISD::SETNE);
|
||||||
SDValue Sel = DAG.getNode(ISD::SELECT, dl, MVT::i64, Ne, Or, Op0);
|
SDValue Sel = DAG.getSelect(dl, MVT::i64, Ne, Or, Op0);
|
||||||
SDValue Ge = DAG.getSetCC(dl, getSetCCResultType(MVT::i64),
|
SDValue Ge = DAG.getSetCC(dl, getSetCCResultType(MVT::i64),
|
||||||
Op0, DAG.getConstant(UINT64_C(0x0020000000000000), MVT::i64),
|
Op0, DAG.getConstant(UINT64_C(0x0020000000000000), MVT::i64),
|
||||||
ISD::SETUGE);
|
ISD::SETUGE);
|
||||||
SDValue Sel2 = DAG.getNode(ISD::SELECT, dl, MVT::i64, Ge, Sel, Op0);
|
SDValue Sel2 = DAG.getSelect(dl, MVT::i64, Ge, Sel, Op0);
|
||||||
EVT SHVT = TLI.getShiftAmountTy(Sel2.getValueType());
|
EVT SHVT = TLI.getShiftAmountTy(Sel2.getValueType());
|
||||||
|
|
||||||
SDValue Sh = DAG.getNode(ISD::SRL, dl, MVT::i64, Sel2,
|
SDValue Sh = DAG.getNode(ISD::SRL, dl, MVT::i64, Sel2,
|
||||||
@ -2375,7 +2375,7 @@ SDValue SelectionDAGLegalize::ExpandLegalINT_TO_FP(bool isSigned,
|
|||||||
Op0, DAG.getConstant(0, Op0.getValueType()),
|
Op0, DAG.getConstant(0, Op0.getValueType()),
|
||||||
ISD::SETLT);
|
ISD::SETLT);
|
||||||
SDValue Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4);
|
SDValue Zero = DAG.getIntPtrConstant(0), Four = DAG.getIntPtrConstant(4);
|
||||||
SDValue CstOffset = DAG.getNode(ISD::SELECT, dl, Zero.getValueType(),
|
SDValue CstOffset = DAG.getSelect(dl, Zero.getValueType(),
|
||||||
SignSet, Four, Zero);
|
SignSet, Four, Zero);
|
||||||
|
|
||||||
// If the sign bit of the integer is set, the large number will be treated
|
// If the sign bit of the integer is set, the large number will be treated
|
||||||
@ -2928,7 +2928,7 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node) {
|
|||||||
Node->getOperand(0), Tmp1));
|
Node->getOperand(0), Tmp1));
|
||||||
False = DAG.getNode(ISD::XOR, dl, NVT, False,
|
False = DAG.getNode(ISD::XOR, dl, NVT, False,
|
||||||
DAG.getConstant(x, NVT));
|
DAG.getConstant(x, NVT));
|
||||||
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp2, True, False);
|
Tmp1 = DAG.getSelect(dl, NVT, Tmp2, True, False);
|
||||||
Results.push_back(Tmp1);
|
Results.push_back(Tmp1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3140,7 +3140,7 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node) {
|
|||||||
Tmp2 = DAG.getSetCC(dl, getSetCCResultType(Tmp1.getValueType()),
|
Tmp2 = DAG.getSetCC(dl, getSetCCResultType(Tmp1.getValueType()),
|
||||||
Tmp1, Tmp2, ISD::SETUGT);
|
Tmp1, Tmp2, ISD::SETUGT);
|
||||||
Tmp3 = DAG.getNode(ISD::FNEG, dl, VT, Tmp1);
|
Tmp3 = DAG.getNode(ISD::FNEG, dl, VT, Tmp1);
|
||||||
Tmp1 = DAG.getNode(ISD::SELECT, dl, VT, Tmp2, Tmp1, Tmp3);
|
Tmp1 = DAG.getSelect(dl, VT, Tmp2, Tmp1, Tmp3);
|
||||||
Results.push_back(Tmp1);
|
Results.push_back(Tmp1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -3762,8 +3762,8 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
|
|||||||
Tmp2 = DAG.getSetCC(dl, getSetCCResultType(NVT),
|
Tmp2 = DAG.getSetCC(dl, getSetCCResultType(NVT),
|
||||||
Tmp1, DAG.getConstant(NVT.getSizeInBits(), NVT),
|
Tmp1, DAG.getConstant(NVT.getSizeInBits(), NVT),
|
||||||
ISD::SETEQ);
|
ISD::SETEQ);
|
||||||
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp2,
|
Tmp1 = DAG.getSelect(dl, NVT, Tmp2,
|
||||||
DAG.getConstant(OVT.getSizeInBits(), NVT), Tmp1);
|
DAG.getConstant(OVT.getSizeInBits(), NVT), Tmp1);
|
||||||
} else if (Node->getOpcode() == ISD::CTLZ ||
|
} else if (Node->getOpcode() == ISD::CTLZ ||
|
||||||
Node->getOpcode() == ISD::CTLZ_ZERO_UNDEF) {
|
Node->getOpcode() == ISD::CTLZ_ZERO_UNDEF) {
|
||||||
// Tmp1 = Tmp1 - (sizeinbits(NVT) - sizeinbits(Old VT))
|
// Tmp1 = Tmp1 - (sizeinbits(NVT) - sizeinbits(Old VT))
|
||||||
@ -3858,7 +3858,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
|
|||||||
Tmp2 = DAG.getNode(ExtOp, dl, NVT, Node->getOperand(1));
|
Tmp2 = DAG.getNode(ExtOp, dl, NVT, Node->getOperand(1));
|
||||||
Tmp3 = DAG.getNode(ExtOp, dl, NVT, Node->getOperand(2));
|
Tmp3 = DAG.getNode(ExtOp, dl, NVT, Node->getOperand(2));
|
||||||
// Perform the larger operation, then round down.
|
// Perform the larger operation, then round down.
|
||||||
Tmp1 = DAG.getNode(ISD::SELECT, dl, NVT, Tmp1, Tmp2, Tmp3);
|
Tmp1 = DAG.getSelect(dl, NVT, Tmp1, Tmp2, Tmp3);
|
||||||
if (TruncOp != ISD::FP_ROUND)
|
if (TruncOp != ISD::FP_ROUND)
|
||||||
Tmp1 = DAG.getNode(TruncOp, dl, Node->getValueType(0), Tmp1);
|
Tmp1 = DAG.getNode(TruncOp, dl, Node->getValueType(0), Tmp1);
|
||||||
else
|
else
|
||||||
|
@ -526,8 +526,8 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_LOAD(SDNode *N) {
|
|||||||
SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT(SDNode *N) {
|
SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT(SDNode *N) {
|
||||||
SDValue LHS = GetSoftenedFloat(N->getOperand(1));
|
SDValue LHS = GetSoftenedFloat(N->getOperand(1));
|
||||||
SDValue RHS = GetSoftenedFloat(N->getOperand(2));
|
SDValue RHS = GetSoftenedFloat(N->getOperand(2));
|
||||||
return DAG.getNode(ISD::SELECT, SDLoc(N),
|
return DAG.getSelect(SDLoc(N),
|
||||||
LHS.getValueType(), N->getOperand(0),LHS,RHS);
|
LHS.getValueType(), N->getOperand(0), LHS, RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT_CC(SDNode *N) {
|
SDValue DAGTypeLegalizer::SoftenFloatRes_SELECT_CC(SDNode *N) {
|
||||||
@ -855,9 +855,9 @@ void DAGTypeLegalizer::ExpandFloatRes_FABS(SDNode *N, SDValue &Lo,
|
|||||||
GetExpandedFloat(N->getOperand(0), Lo, Tmp);
|
GetExpandedFloat(N->getOperand(0), Lo, Tmp);
|
||||||
Hi = DAG.getNode(ISD::FABS, dl, Tmp.getValueType(), Tmp);
|
Hi = DAG.getNode(ISD::FABS, dl, Tmp.getValueType(), Tmp);
|
||||||
// Lo = Hi==fabs(Hi) ? Lo : -Lo;
|
// Lo = Hi==fabs(Hi) ? Lo : -Lo;
|
||||||
Lo = DAG.getNode(ISD::SELECT_CC, dl, Lo.getValueType(), Tmp, Hi, Lo,
|
Lo = DAG.getSelectCC(dl, Tmp, Hi, Lo,
|
||||||
DAG.getNode(ISD::FNEG, dl, Lo.getValueType(), Lo),
|
DAG.getNode(ISD::FNEG, dl, Lo.getValueType(), Lo),
|
||||||
DAG.getCondCode(ISD::SETEQ));
|
ISD::SETEQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DAGTypeLegalizer::ExpandFloatRes_FADD(SDNode *N, SDValue &Lo,
|
void DAGTypeLegalizer::ExpandFloatRes_FADD(SDNode *N, SDValue &Lo,
|
||||||
@ -1216,8 +1216,8 @@ void DAGTypeLegalizer::ExpandFloatRes_XINT_TO_FP(SDNode *N, SDValue &Lo,
|
|||||||
DAG.getConstantFP(APFloat(APFloat::PPCDoubleDouble,
|
DAG.getConstantFP(APFloat(APFloat::PPCDoubleDouble,
|
||||||
APInt(128, Parts)),
|
APInt(128, Parts)),
|
||||||
MVT::ppcf128));
|
MVT::ppcf128));
|
||||||
Lo = DAG.getNode(ISD::SELECT_CC, dl, VT, Src, DAG.getConstant(0, SrcVT),
|
Lo = DAG.getSelectCC(dl, Src, DAG.getConstant(0, SrcVT),
|
||||||
Lo, Hi, DAG.getCondCode(ISD::SETLT));
|
Lo, Hi, ISD::SETLT);
|
||||||
GetPairElements(Lo, Lo, Hi);
|
GetPairElements(Lo, Lo, Hi);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1370,17 +1370,17 @@ SDValue DAGTypeLegalizer::ExpandFloatOp_FP_TO_UINT(SDNode *N) {
|
|||||||
SDValue Tmp = DAG.getConstantFP(APF, MVT::ppcf128);
|
SDValue Tmp = DAG.getConstantFP(APF, MVT::ppcf128);
|
||||||
// X>=2^31 ? (int)(X-2^31)+0x80000000 : (int)X
|
// X>=2^31 ? (int)(X-2^31)+0x80000000 : (int)X
|
||||||
// FIXME: generated code sucks.
|
// FIXME: generated code sucks.
|
||||||
return DAG.getNode(ISD::SELECT_CC, dl, MVT::i32, N->getOperand(0), Tmp,
|
return DAG.getSelectCC(dl, N->getOperand(0), Tmp,
|
||||||
DAG.getNode(ISD::ADD, dl, MVT::i32,
|
DAG.getNode(ISD::ADD, dl, MVT::i32,
|
||||||
DAG.getNode(ISD::FP_TO_SINT, dl, MVT::i32,
|
DAG.getNode(ISD::FP_TO_SINT, dl, MVT::i32,
|
||||||
DAG.getNode(ISD::FSUB, dl,
|
DAG.getNode(ISD::FSUB, dl,
|
||||||
MVT::ppcf128,
|
MVT::ppcf128,
|
||||||
N->getOperand(0),
|
N->getOperand(0),
|
||||||
Tmp)),
|
Tmp)),
|
||||||
DAG.getConstant(0x80000000, MVT::i32)),
|
DAG.getConstant(0x80000000, MVT::i32)),
|
||||||
DAG.getNode(ISD::FP_TO_SINT, dl,
|
DAG.getNode(ISD::FP_TO_SINT, dl,
|
||||||
MVT::i32, N->getOperand(0)),
|
MVT::i32, N->getOperand(0)),
|
||||||
DAG.getCondCode(ISD::SETGE));
|
ISD::SETGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
RTLIB::Libcall LC = RTLIB::getFPTOUINT(N->getOperand(0).getValueType(), RVT);
|
RTLIB::Libcall LC = RTLIB::getFPTOUINT(N->getOperand(0).getValueType(), RVT);
|
||||||
|
@ -483,8 +483,8 @@ SDValue DAGTypeLegalizer::PromoteIntRes_SDIV(SDNode *N) {
|
|||||||
SDValue DAGTypeLegalizer::PromoteIntRes_SELECT(SDNode *N) {
|
SDValue DAGTypeLegalizer::PromoteIntRes_SELECT(SDNode *N) {
|
||||||
SDValue LHS = GetPromotedInteger(N->getOperand(1));
|
SDValue LHS = GetPromotedInteger(N->getOperand(1));
|
||||||
SDValue RHS = GetPromotedInteger(N->getOperand(2));
|
SDValue RHS = GetPromotedInteger(N->getOperand(2));
|
||||||
return DAG.getNode(ISD::SELECT, SDLoc(N),
|
return DAG.getSelect(SDLoc(N),
|
||||||
LHS.getValueType(), N->getOperand(0),LHS,RHS);
|
LHS.getValueType(), N->getOperand(0), LHS, RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDValue DAGTypeLegalizer::PromoteIntRes_VSELECT(SDNode *N) {
|
SDValue DAGTypeLegalizer::PromoteIntRes_VSELECT(SDNode *N) {
|
||||||
@ -1478,8 +1478,8 @@ ExpandShiftWithUnknownAmountBit(SDNode *N, SDValue &Lo, SDValue &Hi) {
|
|||||||
LoL = DAG.getConstant(0, NVT); // Lo part is zero.
|
LoL = DAG.getConstant(0, NVT); // Lo part is zero.
|
||||||
HiL = DAG.getNode(ISD::SHL, dl, NVT, InL, AmtExcess); // Hi from Lo part.
|
HiL = DAG.getNode(ISD::SHL, dl, NVT, InL, AmtExcess); // Hi from Lo part.
|
||||||
|
|
||||||
Lo = DAG.getNode(ISD::SELECT, dl, NVT, isShort, LoS, LoL);
|
Lo = DAG.getSelect(dl, NVT, isShort, LoS, LoL);
|
||||||
Hi = DAG.getNode(ISD::SELECT, dl, NVT, isShort, HiS, HiL);
|
Hi = DAG.getSelect(dl, NVT, isShort, HiS, HiL);
|
||||||
return true;
|
return true;
|
||||||
case ISD::SRL:
|
case ISD::SRL:
|
||||||
// Short: ShAmt < NVTBits
|
// Short: ShAmt < NVTBits
|
||||||
@ -1494,8 +1494,8 @@ ExpandShiftWithUnknownAmountBit(SDNode *N, SDValue &Lo, SDValue &Hi) {
|
|||||||
HiL = DAG.getConstant(0, NVT); // Hi part is zero.
|
HiL = DAG.getConstant(0, NVT); // Hi part is zero.
|
||||||
LoL = DAG.getNode(ISD::SRL, dl, NVT, InH, AmtExcess); // Lo from Hi part.
|
LoL = DAG.getNode(ISD::SRL, dl, NVT, InH, AmtExcess); // Lo from Hi part.
|
||||||
|
|
||||||
Lo = DAG.getNode(ISD::SELECT, dl, NVT, isShort, LoS, LoL);
|
Lo = DAG.getSelect(dl, NVT, isShort, LoS, LoL);
|
||||||
Hi = DAG.getNode(ISD::SELECT, dl, NVT, isShort, HiS, HiL);
|
Hi = DAG.getSelect(dl, NVT, isShort, HiS, HiL);
|
||||||
return true;
|
return true;
|
||||||
case ISD::SRA:
|
case ISD::SRA:
|
||||||
// Short: ShAmt < NVTBits
|
// Short: ShAmt < NVTBits
|
||||||
@ -1511,8 +1511,8 @@ ExpandShiftWithUnknownAmountBit(SDNode *N, SDValue &Lo, SDValue &Hi) {
|
|||||||
DAG.getConstant(NVTBits-1, ShTy));
|
DAG.getConstant(NVTBits-1, ShTy));
|
||||||
LoL = DAG.getNode(ISD::SRA, dl, NVT, InH, AmtExcess); // Lo from Hi part.
|
LoL = DAG.getNode(ISD::SRA, dl, NVT, InH, AmtExcess); // Lo from Hi part.
|
||||||
|
|
||||||
Lo = DAG.getNode(ISD::SELECT, dl, NVT, isShort, LoS, LoL);
|
Lo = DAG.getSelect(dl, NVT, isShort, LoS, LoL);
|
||||||
Hi = DAG.getNode(ISD::SELECT, dl, NVT, isShort, HiS, HiL);
|
Hi = DAG.getSelect(dl, NVT, isShort, HiS, HiL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1558,13 +1558,13 @@ void DAGTypeLegalizer::ExpandIntRes_ADDSUB(SDNode *N,
|
|||||||
Hi = DAG.getNode(ISD::ADD, dl, NVT, HiOps, 2);
|
Hi = DAG.getNode(ISD::ADD, dl, NVT, HiOps, 2);
|
||||||
SDValue Cmp1 = DAG.getSetCC(dl, getSetCCResultType(NVT), Lo, LoOps[0],
|
SDValue Cmp1 = DAG.getSetCC(dl, getSetCCResultType(NVT), Lo, LoOps[0],
|
||||||
ISD::SETULT);
|
ISD::SETULT);
|
||||||
SDValue Carry1 = DAG.getNode(ISD::SELECT, dl, NVT, Cmp1,
|
SDValue Carry1 = DAG.getSelect(dl, NVT, Cmp1,
|
||||||
DAG.getConstant(1, NVT),
|
DAG.getConstant(1, NVT),
|
||||||
DAG.getConstant(0, NVT));
|
DAG.getConstant(0, NVT));
|
||||||
SDValue Cmp2 = DAG.getSetCC(dl, getSetCCResultType(NVT), Lo, LoOps[1],
|
SDValue Cmp2 = DAG.getSetCC(dl, getSetCCResultType(NVT), Lo, LoOps[1],
|
||||||
ISD::SETULT);
|
ISD::SETULT);
|
||||||
SDValue Carry2 = DAG.getNode(ISD::SELECT, dl, NVT, Cmp2,
|
SDValue Carry2 = DAG.getSelect(dl, NVT, Cmp2,
|
||||||
DAG.getConstant(1, NVT), Carry1);
|
DAG.getConstant(1, NVT), Carry1);
|
||||||
Hi = DAG.getNode(ISD::ADD, dl, NVT, Hi, Carry2);
|
Hi = DAG.getNode(ISD::ADD, dl, NVT, Hi, Carry2);
|
||||||
} else {
|
} else {
|
||||||
Lo = DAG.getNode(ISD::SUB, dl, NVT, LoOps, 2);
|
Lo = DAG.getNode(ISD::SUB, dl, NVT, LoOps, 2);
|
||||||
@ -1572,9 +1572,9 @@ void DAGTypeLegalizer::ExpandIntRes_ADDSUB(SDNode *N,
|
|||||||
SDValue Cmp =
|
SDValue Cmp =
|
||||||
DAG.getSetCC(dl, getSetCCResultType(LoOps[0].getValueType()),
|
DAG.getSetCC(dl, getSetCCResultType(LoOps[0].getValueType()),
|
||||||
LoOps[0], LoOps[1], ISD::SETULT);
|
LoOps[0], LoOps[1], ISD::SETULT);
|
||||||
SDValue Borrow = DAG.getNode(ISD::SELECT, dl, NVT, Cmp,
|
SDValue Borrow = DAG.getSelect(dl, NVT, Cmp,
|
||||||
DAG.getConstant(1, NVT),
|
DAG.getConstant(1, NVT),
|
||||||
DAG.getConstant(0, NVT));
|
DAG.getConstant(0, NVT));
|
||||||
Hi = DAG.getNode(ISD::SUB, dl, NVT, Hi, Borrow);
|
Hi = DAG.getNode(ISD::SUB, dl, NVT, Hi, Borrow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1725,9 +1725,9 @@ void DAGTypeLegalizer::ExpandIntRes_CTLZ(SDNode *N,
|
|||||||
SDValue LoLZ = DAG.getNode(N->getOpcode(), dl, NVT, Lo);
|
SDValue LoLZ = DAG.getNode(N->getOpcode(), dl, NVT, Lo);
|
||||||
SDValue HiLZ = DAG.getNode(ISD::CTLZ_ZERO_UNDEF, dl, NVT, Hi);
|
SDValue HiLZ = DAG.getNode(ISD::CTLZ_ZERO_UNDEF, dl, NVT, Hi);
|
||||||
|
|
||||||
Lo = DAG.getNode(ISD::SELECT, dl, NVT, HiNotZero, HiLZ,
|
Lo = DAG.getSelect(dl, NVT, HiNotZero, HiLZ,
|
||||||
DAG.getNode(ISD::ADD, dl, NVT, LoLZ,
|
DAG.getNode(ISD::ADD, dl, NVT, LoLZ,
|
||||||
DAG.getConstant(NVT.getSizeInBits(), NVT)));
|
DAG.getConstant(NVT.getSizeInBits(), NVT)));
|
||||||
Hi = DAG.getConstant(0, NVT);
|
Hi = DAG.getConstant(0, NVT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1755,9 +1755,9 @@ void DAGTypeLegalizer::ExpandIntRes_CTTZ(SDNode *N,
|
|||||||
SDValue LoLZ = DAG.getNode(ISD::CTTZ_ZERO_UNDEF, dl, NVT, Lo);
|
SDValue LoLZ = DAG.getNode(ISD::CTTZ_ZERO_UNDEF, dl, NVT, Lo);
|
||||||
SDValue HiLZ = DAG.getNode(N->getOpcode(), dl, NVT, Hi);
|
SDValue HiLZ = DAG.getNode(N->getOpcode(), dl, NVT, Hi);
|
||||||
|
|
||||||
Lo = DAG.getNode(ISD::SELECT, dl, NVT, LoNotZero, LoLZ,
|
Lo = DAG.getSelect(dl, NVT, LoNotZero, LoLZ,
|
||||||
DAG.getNode(ISD::ADD, dl, NVT, HiLZ,
|
DAG.getNode(ISD::ADD, dl, NVT, HiLZ,
|
||||||
DAG.getConstant(NVT.getSizeInBits(), NVT)));
|
DAG.getConstant(NVT.getSizeInBits(), NVT)));
|
||||||
Hi = DAG.getConstant(0, NVT);
|
Hi = DAG.getConstant(0, NVT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2289,14 +2289,14 @@ void DAGTypeLegalizer::ExpandIntRes_XMULO(SDNode *N,
|
|||||||
// make sure we aren't using 0.
|
// make sure we aren't using 0.
|
||||||
SDValue isZero = DAG.getSetCC(dl, getSetCCResultType(VT),
|
SDValue isZero = DAG.getSetCC(dl, getSetCCResultType(VT),
|
||||||
RHS, DAG.getConstant(0, VT), ISD::SETEQ);
|
RHS, DAG.getConstant(0, VT), ISD::SETEQ);
|
||||||
SDValue NotZero = DAG.getNode(ISD::SELECT, dl, VT, isZero,
|
SDValue NotZero = DAG.getSelect(dl, VT, isZero,
|
||||||
DAG.getConstant(1, VT), RHS);
|
DAG.getConstant(1, VT), RHS);
|
||||||
SDValue DIV = DAG.getNode(ISD::UDIV, dl, VT, MUL, NotZero);
|
SDValue DIV = DAG.getNode(ISD::UDIV, dl, VT, MUL, NotZero);
|
||||||
SDValue Overflow = DAG.getSetCC(dl, N->getValueType(1), DIV, LHS,
|
SDValue Overflow = DAG.getSetCC(dl, N->getValueType(1), DIV, LHS,
|
||||||
ISD::SETNE);
|
ISD::SETNE);
|
||||||
Overflow = DAG.getNode(ISD::SELECT, dl, N->getValueType(1), isZero,
|
Overflow = DAG.getSelect(dl, N->getValueType(1), isZero,
|
||||||
DAG.getConstant(0, N->getValueType(1)),
|
DAG.getConstant(0, N->getValueType(1)),
|
||||||
Overflow);
|
Overflow);
|
||||||
ReplaceValueWith(SDValue(N, 1), Overflow);
|
ReplaceValueWith(SDValue(N, 1), Overflow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2601,8 +2601,8 @@ void DAGTypeLegalizer::IntegerExpandSetCCOperands(SDValue &NewLHS,
|
|||||||
if (!NewLHS.getNode())
|
if (!NewLHS.getNode())
|
||||||
NewLHS = DAG.getSetCC(dl, getSetCCResultType(LHSHi.getValueType()),
|
NewLHS = DAG.getSetCC(dl, getSetCCResultType(LHSHi.getValueType()),
|
||||||
LHSHi, RHSHi, ISD::SETEQ);
|
LHSHi, RHSHi, ISD::SETEQ);
|
||||||
NewLHS = DAG.getNode(ISD::SELECT, dl, Tmp1.getValueType(),
|
NewLHS = DAG.getSelect(dl, Tmp1.getValueType(),
|
||||||
NewLHS, Tmp1, Tmp2);
|
NewLHS, Tmp1, Tmp2);
|
||||||
NewRHS = SDValue();
|
NewRHS = SDValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2830,8 +2830,8 @@ SDValue DAGTypeLegalizer::ExpandIntOp_UINT_TO_FP(SDNode *N) {
|
|||||||
SDValue Zero = DAG.getIntPtrConstant(0);
|
SDValue Zero = DAG.getIntPtrConstant(0);
|
||||||
SDValue Four = DAG.getIntPtrConstant(4);
|
SDValue Four = DAG.getIntPtrConstant(4);
|
||||||
if (TLI.isBigEndian()) std::swap(Zero, Four);
|
if (TLI.isBigEndian()) std::swap(Zero, Four);
|
||||||
SDValue Offset = DAG.getNode(ISD::SELECT, dl, Zero.getValueType(), SignSet,
|
SDValue Offset = DAG.getSelect(dl, Zero.getValueType(), SignSet,
|
||||||
Zero, Four);
|
Zero, Four);
|
||||||
unsigned Alignment = cast<ConstantPoolSDNode>(FudgePtr)->getAlignment();
|
unsigned Alignment = cast<ConstantPoolSDNode>(FudgePtr)->getAlignment();
|
||||||
FudgePtr = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(), FudgePtr, Offset);
|
FudgePtr = DAG.getNode(ISD::ADD, dl, TLI.getPointerTy(), FudgePtr, Offset);
|
||||||
Alignment = std::min(Alignment, 4u);
|
Alignment = std::min(Alignment, 4u);
|
||||||
|
@ -605,7 +605,7 @@ SDValue VectorLegalizer::ExpandSELECT(SDValue Op) {
|
|||||||
// What is the size of each element in the vector mask.
|
// What is the size of each element in the vector mask.
|
||||||
EVT BitTy = MaskTy.getScalarType();
|
EVT BitTy = MaskTy.getScalarType();
|
||||||
|
|
||||||
Mask = DAG.getNode(ISD::SELECT, DL, BitTy, Mask,
|
Mask = DAG.getSelect(DL, BitTy, Mask,
|
||||||
DAG.getConstant(APInt::getAllOnesValue(BitTy.getSizeInBits()), BitTy),
|
DAG.getConstant(APInt::getAllOnesValue(BitTy.getSizeInBits()), BitTy),
|
||||||
DAG.getConstant(0, BitTy));
|
DAG.getConstant(0, BitTy));
|
||||||
|
|
||||||
@ -761,10 +761,10 @@ SDValue VectorLegalizer::UnrollVSETCC(SDValue Op) {
|
|||||||
Ops[i] = DAG.getNode(ISD::SETCC, dl,
|
Ops[i] = DAG.getNode(ISD::SETCC, dl,
|
||||||
TLI.getSetCCResultType(*DAG.getContext(), TmpEltVT),
|
TLI.getSetCCResultType(*DAG.getContext(), TmpEltVT),
|
||||||
LHSElem, RHSElem, CC);
|
LHSElem, RHSElem, CC);
|
||||||
Ops[i] = DAG.getNode(ISD::SELECT, dl, EltVT, Ops[i],
|
Ops[i] = DAG.getSelect(dl, EltVT, Ops[i],
|
||||||
DAG.getConstant(APInt::getAllOnesValue
|
DAG.getConstant(APInt::getAllOnesValue
|
||||||
(EltVT.getSizeInBits()), EltVT),
|
(EltVT.getSizeInBits()), EltVT),
|
||||||
DAG.getConstant(0, EltVT));
|
DAG.getConstant(0, EltVT));
|
||||||
}
|
}
|
||||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Ops[0], NumElems);
|
return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Ops[0], NumElems);
|
||||||
}
|
}
|
||||||
|
@ -274,16 +274,17 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_VSELECT(SDNode *N) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return DAG.getNode(ISD::SELECT, SDLoc(N),
|
|
||||||
LHS.getValueType(), Cond, LHS,
|
return DAG.getSelect(SDLoc(N),
|
||||||
GetScalarizedVector(N->getOperand(2)));
|
LHS.getValueType(), Cond, LHS,
|
||||||
|
GetScalarizedVector(N->getOperand(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
SDValue DAGTypeLegalizer::ScalarizeVecRes_SELECT(SDNode *N) {
|
SDValue DAGTypeLegalizer::ScalarizeVecRes_SELECT(SDNode *N) {
|
||||||
SDValue LHS = GetScalarizedVector(N->getOperand(1));
|
SDValue LHS = GetScalarizedVector(N->getOperand(1));
|
||||||
return DAG.getNode(ISD::SELECT, SDLoc(N),
|
return DAG.getSelect(SDLoc(N),
|
||||||
LHS.getValueType(), N->getOperand(0), LHS,
|
LHS.getValueType(), N->getOperand(0), LHS,
|
||||||
GetScalarizedVector(N->getOperand(2)));
|
GetScalarizedVector(N->getOperand(2)));
|
||||||
}
|
}
|
||||||
|
|
||||||
SDValue DAGTypeLegalizer::ScalarizeVecRes_SELECT_CC(SDNode *N) {
|
SDValue DAGTypeLegalizer::ScalarizeVecRes_SELECT_CC(SDNode *N) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user