forked from OSchip/llvm-project
Convert SelectionDAG::SelectNodeTo to use ArrayRef.
llvm-svn: 207377
This commit is contained in:
parent
dd5e16dd34
commit
481fb2879f
|
@ -840,15 +840,14 @@ public:
|
|||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT,
|
||||
SDValue Op1, SDValue Op2, SDValue Op3);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT,
|
||||
const SDValue *Ops, unsigned NumOps);
|
||||
ArrayRef<SDValue> Ops);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1, EVT VT2);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
|
||||
EVT VT2, const SDValue *Ops, unsigned NumOps);
|
||||
EVT VT2, ArrayRef<SDValue> Ops);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
|
||||
EVT VT2, EVT VT3, const SDValue *Ops, unsigned NumOps);
|
||||
EVT VT2, EVT VT3, ArrayRef<SDValue> Ops);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned MachineOpc, EVT VT1,
|
||||
EVT VT2, EVT VT3, EVT VT4, const SDValue *Ops,
|
||||
unsigned NumOps);
|
||||
EVT VT2, EVT VT3, EVT VT4, ArrayRef<SDValue> Ops);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
|
||||
EVT VT2, SDValue Op1);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
|
||||
|
@ -858,7 +857,7 @@ public:
|
|||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, EVT VT1,
|
||||
EVT VT2, EVT VT3, SDValue Op1, SDValue Op2, SDValue Op3);
|
||||
SDNode *SelectNodeTo(SDNode *N, unsigned TargetOpc, SDVTList VTs,
|
||||
const SDValue *Ops, unsigned NumOps);
|
||||
ArrayRef<SDValue> Ops);
|
||||
|
||||
/// MorphNodeTo - This *mutates* the specified node to have the specified
|
||||
/// return type, opcode, and operands.
|
||||
|
|
|
@ -5207,14 +5207,14 @@ void SDNode::DropOperands() {
|
|||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT) {
|
||||
SDVTList VTs = getVTList(VT);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, nullptr, 0);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, None);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT, SDValue Op1) {
|
||||
SDVTList VTs = getVTList(VT);
|
||||
SDValue Ops[] = { Op1 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 1);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
|
@ -5222,7 +5222,7 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
|||
SDValue Op2) {
|
||||
SDVTList VTs = getVTList(VT);
|
||||
SDValue Ops[] = { Op1, Op2 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 2);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
|
@ -5230,41 +5230,39 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
|||
SDValue Op2, SDValue Op3) {
|
||||
SDVTList VTs = getVTList(VT);
|
||||
SDValue Ops[] = { Op1, Op2, Op3 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 3);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT, const SDValue *Ops,
|
||||
unsigned NumOps) {
|
||||
EVT VT, ArrayRef<SDValue> Ops) {
|
||||
SDVTList VTs = getVTList(VT);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT1, EVT VT2, const SDValue *Ops,
|
||||
unsigned NumOps) {
|
||||
EVT VT1, EVT VT2, ArrayRef<SDValue> Ops) {
|
||||
SDVTList VTs = getVTList(VT1, VT2);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT1, EVT VT2) {
|
||||
SDVTList VTs = getVTList(VT1, VT2);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, (SDValue *)nullptr, 0);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, None);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT1, EVT VT2, EVT VT3,
|
||||
const SDValue *Ops, unsigned NumOps) {
|
||||
ArrayRef<SDValue> Ops) {
|
||||
SDVTList VTs = getVTList(VT1, VT2, VT3);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
EVT VT1, EVT VT2, EVT VT3, EVT VT4,
|
||||
const SDValue *Ops, unsigned NumOps) {
|
||||
ArrayRef<SDValue> Ops) {
|
||||
SDVTList VTs = getVTList(VT1, VT2, VT3, VT4);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, NumOps);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
|
@ -5272,7 +5270,7 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
|||
SDValue Op1) {
|
||||
SDVTList VTs = getVTList(VT1, VT2);
|
||||
SDValue Ops[] = { Op1 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 1);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
|
@ -5280,7 +5278,7 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
|||
SDValue Op1, SDValue Op2) {
|
||||
SDVTList VTs = getVTList(VT1, VT2);
|
||||
SDValue Ops[] = { Op1, Op2 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 2);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
|
@ -5289,7 +5287,7 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
|||
SDValue Op3) {
|
||||
SDVTList VTs = getVTList(VT1, VT2);
|
||||
SDValue Ops[] = { Op1, Op2, Op3 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 3);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
|
@ -5298,13 +5296,12 @@ SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
|||
SDValue Op3) {
|
||||
SDVTList VTs = getVTList(VT1, VT2, VT3);
|
||||
SDValue Ops[] = { Op1, Op2, Op3 };
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops, 3);
|
||||
return SelectNodeTo(N, MachineOpc, VTs, Ops);
|
||||
}
|
||||
|
||||
SDNode *SelectionDAG::SelectNodeTo(SDNode *N, unsigned MachineOpc,
|
||||
SDVTList VTs, const SDValue *Ops,
|
||||
unsigned NumOps) {
|
||||
N = MorphNodeTo(N, ~MachineOpc, VTs, Ops, NumOps);
|
||||
SDVTList VTs,ArrayRef<SDValue> Ops) {
|
||||
N = MorphNodeTo(N, ~MachineOpc, VTs, Ops.data(), Ops.size());
|
||||
// Reset the NodeID to -1.
|
||||
N->setNodeId(-1);
|
||||
return N;
|
||||
|
|
|
@ -425,9 +425,7 @@ SDNode *AArch64DAGToDAGISel::SelectAtomic(SDNode *Node, unsigned Op8,
|
|||
Ops.push_back(CurDAG->getTargetConstant(AN->getOrdering(), MVT::i32));
|
||||
Ops.push_back(AN->getOperand(0)); // Chain moves to the end
|
||||
|
||||
return CurDAG->SelectNodeTo(Node, Op,
|
||||
AN->getValueType(0), MVT::Other,
|
||||
&Ops[0], Ops.size());
|
||||
return CurDAG->SelectNodeTo(Node, Op, AN->getValueType(0), MVT::Other, Ops);
|
||||
}
|
||||
|
||||
SDValue AArch64DAGToDAGISel::createDTuple(ArrayRef<SDValue> Regs) {
|
||||
|
|
|
@ -2316,7 +2316,7 @@ SDNode *ARMDAGToDAGISel::SelectV6T2BitfieldExtractOp(SDNode *N,
|
|||
SDValue Ops[] = { N->getOperand(0).getOperand(0),
|
||||
CurDAG->getTargetConstant(LSB, MVT::i32),
|
||||
getAL(CurDAG), Reg0, Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops, 5);
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
|
||||
}
|
||||
|
||||
// ARM models shift instructions as MOVsi with shifter operand.
|
||||
|
@ -2326,14 +2326,14 @@ SDNode *ARMDAGToDAGISel::SelectV6T2BitfieldExtractOp(SDNode *N,
|
|||
MVT::i32);
|
||||
SDValue Ops[] = { N->getOperand(0).getOperand(0), ShOpc,
|
||||
getAL(CurDAG), Reg0, Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, ARM::MOVsi, MVT::i32, Ops, 5);
|
||||
return CurDAG->SelectNodeTo(N, ARM::MOVsi, MVT::i32, Ops);
|
||||
}
|
||||
|
||||
SDValue Ops[] = { N->getOperand(0).getOperand(0),
|
||||
CurDAG->getTargetConstant(LSB, MVT::i32),
|
||||
CurDAG->getTargetConstant(Width, MVT::i32),
|
||||
getAL(CurDAG), Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops, 5);
|
||||
getAL(CurDAG), Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -2356,7 +2356,7 @@ SDNode *ARMDAGToDAGISel::SelectV6T2BitfieldExtractOp(SDNode *N,
|
|||
CurDAG->getTargetConstant(LSB, MVT::i32),
|
||||
CurDAG->getTargetConstant(Width, MVT::i32),
|
||||
getAL(CurDAG), Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops, 5);
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -2493,14 +2493,14 @@ SDNode *ARMDAGToDAGISel::Select(SDNode *N) {
|
|||
if (Subtarget->isThumb1Only()) {
|
||||
SDValue Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32),
|
||||
getAL(CurDAG), CurDAG->getRegister(0, MVT::i32) };
|
||||
return CurDAG->SelectNodeTo(N, ARM::tADDrSPi, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, ARM::tADDrSPi, MVT::i32, Ops);
|
||||
} else {
|
||||
unsigned Opc = ((Subtarget->isThumb() && Subtarget->hasThumb2()) ?
|
||||
ARM::t2ADDri : ARM::ADDri);
|
||||
SDValue Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32),
|
||||
getAL(CurDAG), CurDAG->getRegister(0, MVT::i32),
|
||||
CurDAG->getRegister(0, MVT::i32) };
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops, 5);
|
||||
return CurDAG->SelectNodeTo(N, Opc, MVT::i32, Ops);
|
||||
}
|
||||
}
|
||||
case ISD::SRL:
|
||||
|
@ -2527,10 +2527,10 @@ SDNode *ARMDAGToDAGISel::Select(SDNode *N) {
|
|||
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
|
||||
if (Subtarget->isThumb()) {
|
||||
SDValue Ops[] = { V, V, ShImmOp, getAL(CurDAG), Reg0, Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, ARM::t2ADDrs, MVT::i32, Ops, 6);
|
||||
return CurDAG->SelectNodeTo(N, ARM::t2ADDrs, MVT::i32, Ops);
|
||||
} else {
|
||||
SDValue Ops[] = { V, V, Reg0, ShImmOp, getAL(CurDAG), Reg0, Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, ARM::ADDrsi, MVT::i32, Ops, 7);
|
||||
return CurDAG->SelectNodeTo(N, ARM::ADDrsi, MVT::i32, Ops);
|
||||
}
|
||||
}
|
||||
if (isPowerOf2_32(RHSV+1)) { // 2^n-1?
|
||||
|
@ -2543,10 +2543,10 @@ SDNode *ARMDAGToDAGISel::Select(SDNode *N) {
|
|||
SDValue Reg0 = CurDAG->getRegister(0, MVT::i32);
|
||||
if (Subtarget->isThumb()) {
|
||||
SDValue Ops[] = { V, V, ShImmOp, getAL(CurDAG), Reg0, Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, ARM::t2RSBrs, MVT::i32, Ops, 6);
|
||||
return CurDAG->SelectNodeTo(N, ARM::t2RSBrs, MVT::i32, Ops);
|
||||
} else {
|
||||
SDValue Ops[] = { V, V, Reg0, ShImmOp, getAL(CurDAG), Reg0, Reg0 };
|
||||
return CurDAG->SelectNodeTo(N, ARM::RSBrsi, MVT::i32, Ops, 7);
|
||||
return CurDAG->SelectNodeTo(N, ARM::RSBrsi, MVT::i32, Ops);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1391,7 +1391,7 @@ SDNode *ARM64DAGToDAGISel::SelectBitfieldExtractOp(SDNode *N) {
|
|||
|
||||
SDValue Ops[] = {Opd0, CurDAG->getTargetConstant(LSB, VT),
|
||||
CurDAG->getTargetConstant(MSB, VT)};
|
||||
return CurDAG->SelectNodeTo(N, Opc, VT, Ops, 3);
|
||||
return CurDAG->SelectNodeTo(N, Opc, VT, Ops);
|
||||
}
|
||||
|
||||
/// Does DstMask form a complementary pair with the mask provided by
|
||||
|
@ -1779,7 +1779,7 @@ SDNode *ARM64DAGToDAGISel::SelectBitfieldInsertOp(SDNode *N) {
|
|||
Opd1,
|
||||
CurDAG->getTargetConstant(LSB, VT),
|
||||
CurDAG->getTargetConstant(MSB, VT) };
|
||||
return CurDAG->SelectNodeTo(N, Opc, VT, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, Opc, VT, Ops);
|
||||
}
|
||||
|
||||
SDNode *ARM64DAGToDAGISel::SelectLIBM(SDNode *N) {
|
||||
|
@ -1991,7 +1991,7 @@ SDNode *ARM64DAGToDAGISel::Select(SDNode *Node) {
|
|||
SDValue TFI = CurDAG->getTargetFrameIndex(FI, TLI->getPointerTy());
|
||||
SDValue Ops[] = { TFI, CurDAG->getTargetConstant(0, MVT::i32),
|
||||
CurDAG->getTargetConstant(Shifter, MVT::i32) };
|
||||
return CurDAG->SelectNodeTo(Node, ARM64::ADDXri, MVT::i64, Ops, 3);
|
||||
return CurDAG->SelectNodeTo(Node, ARM64::ADDXri, MVT::i64, Ops);
|
||||
}
|
||||
case ISD::INTRINSIC_W_CHAIN: {
|
||||
unsigned IntNo = cast<ConstantSDNode>(Node->getOperand(1))->getZExtValue();
|
||||
|
|
|
@ -369,9 +369,7 @@ SDNode *MSP430DAGToDAGISel::SelectIndexedBinOp(SDNode *Op,
|
|||
MemRefs0[0] = cast<MemSDNode>(N1)->getMemOperand();
|
||||
SDValue Ops0[] = { N2, LD->getBasePtr(), LD->getChain() };
|
||||
SDNode *ResNode =
|
||||
CurDAG->SelectNodeTo(Op, Opc,
|
||||
VT, MVT::i16, MVT::Other,
|
||||
Ops0, 3);
|
||||
CurDAG->SelectNodeTo(Op, Opc, VT, MVT::i16, MVT::Other, Ops0);
|
||||
cast<MachineSDNode>(ResNode)->setMemRefs(MemRefs0, MemRefs0 + 1);
|
||||
// Transfer chain.
|
||||
ReplaceUses(SDValue(N1.getNode(), 2), SDValue(ResNode, 2));
|
||||
|
|
|
@ -758,7 +758,7 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDNode *N) {
|
|||
case ISD::SETEQ: {
|
||||
Op = SDValue(CurDAG->getMachineNode(PPC::CNTLZW, dl, MVT::i32, Op), 0);
|
||||
SDValue Ops[] = { Op, getI32Imm(27), getI32Imm(5), getI32Imm(31) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
case ISD::SETNE: {
|
||||
if (isPPC64) break;
|
||||
|
@ -770,14 +770,14 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDNode *N) {
|
|||
}
|
||||
case ISD::SETLT: {
|
||||
SDValue Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
case ISD::SETGT: {
|
||||
SDValue T =
|
||||
SDValue(CurDAG->getMachineNode(PPC::NEG, dl, MVT::i32, Op), 0);
|
||||
T = SDValue(CurDAG->getMachineNode(PPC::ANDC, dl, MVT::i32, T, Op), 0);
|
||||
SDValue Ops[] = { T, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
}
|
||||
} else if (Imm == ~0U) { // setcc op, -1
|
||||
|
@ -807,7 +807,7 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDNode *N) {
|
|||
SDValue AN = SDValue(CurDAG->getMachineNode(PPC::AND, dl, MVT::i32, AD,
|
||||
Op), 0);
|
||||
SDValue Ops[] = { AN, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
case ISD::SETGT: {
|
||||
SDValue Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
|
||||
|
@ -904,7 +904,7 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDNode *N) {
|
|||
SDValue Ops[] = { IntCR, getI32Imm((32-(3-Idx)) & 31),
|
||||
getI32Imm(31), getI32Imm(31) };
|
||||
if (!Inv)
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
|
||||
// Get the specified bit.
|
||||
SDValue Tmp =
|
||||
|
@ -1151,7 +1151,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
isRotateAndMask(N->getOperand(0).getNode(), Imm, false, SH, MB, ME)) {
|
||||
SDValue Val = N->getOperand(0).getOperand(0);
|
||||
SDValue Ops[] = { Val, getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
// If this is just a masked value where the input is not handled above, and
|
||||
// is not a rotate-left (handled by a pattern in the .td file), emit rlwinm
|
||||
|
@ -1160,7 +1160,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
N->getOperand(0).getOpcode() != ISD::ROTL) {
|
||||
SDValue Val = N->getOperand(0);
|
||||
SDValue Ops[] = { Val, getI32Imm(0), getI32Imm(MB), getI32Imm(ME) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
// If this is a 64-bit zero-extension mask, emit rldicl.
|
||||
if (isInt64Immediate(N->getOperand(1).getNode(), Imm64) &&
|
||||
|
@ -1182,7 +1182,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
}
|
||||
|
||||
SDValue Ops[] = { Val, getI32Imm(SH), getI32Imm(MB) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Ops, 3);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLDICL, MVT::i64, Ops);
|
||||
}
|
||||
// AND X, 0 -> 0, not "rlwinm 32".
|
||||
if (isInt32Immediate(N->getOperand(1), Imm) && (Imm == 0)) {
|
||||
|
@ -1220,7 +1220,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
isRotateAndMask(N, Imm, true, SH, MB, ME)) {
|
||||
SDValue Ops[] = { N->getOperand(0).getOperand(0),
|
||||
getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
|
||||
// Other cases are autogenerated.
|
||||
|
@ -1232,7 +1232,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
isRotateAndMask(N, Imm, true, SH, MB, ME)) {
|
||||
SDValue Ops[] = { N->getOperand(0).getOperand(0),
|
||||
getI32Imm(SH), getI32Imm(MB), getI32Imm(ME) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::RLWINM, MVT::i32, Ops);
|
||||
}
|
||||
|
||||
// Other cases are autogenerated.
|
||||
|
@ -1335,12 +1335,12 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
|
||||
SDValue Ops[] = { CCReg, N->getOperand(2), N->getOperand(3),
|
||||
getI32Imm(BROpc) };
|
||||
return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, SelectCCOp, N->getValueType(0), Ops);
|
||||
}
|
||||
case ISD::VSELECT:
|
||||
if (PPCSubTarget.hasVSX()) {
|
||||
SDValue Ops[] = { N->getOperand(2), N->getOperand(1), N->getOperand(0) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::XXSEL, N->getValueType(0), Ops, 3);
|
||||
return CurDAG->SelectNodeTo(N, PPC::XXSEL, N->getValueType(0), Ops);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1372,12 +1372,12 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
SDValue Chain = LD->getChain();
|
||||
SDValue Ops[] = { Base, Offset, Chain };
|
||||
return CurDAG->SelectNodeTo(N, PPC::LXVDSX,
|
||||
N->getValueType(0), Ops, 3);
|
||||
N->getValueType(0), Ops);
|
||||
}
|
||||
}
|
||||
|
||||
SDValue Ops[] = { Op1, Op2, DMV };
|
||||
return CurDAG->SelectNodeTo(N, PPC::XXPERMDI, N->getValueType(0), Ops, 3);
|
||||
return CurDAG->SelectNodeTo(N, PPC::XXPERMDI, N->getValueType(0), Ops);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1388,7 +1388,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
return CurDAG->SelectNodeTo(N, N->getOpcode() == PPCISD::BDNZ ?
|
||||
(IsPPC64 ? PPC::BDNZ8 : PPC::BDNZ) :
|
||||
(IsPPC64 ? PPC::BDZ8 : PPC::BDZ),
|
||||
MVT::Other, Ops, 2);
|
||||
MVT::Other, Ops);
|
||||
}
|
||||
case PPCISD::COND_BRANCH: {
|
||||
// Op #0 is the Chain.
|
||||
|
@ -1401,7 +1401,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
getI32Imm(cast<ConstantSDNode>(N->getOperand(1))->getZExtValue());
|
||||
SDValue Ops[] = { Pred, N->getOperand(2), N->getOperand(3),
|
||||
N->getOperand(0), N->getOperand(4) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::BCC, MVT::Other, Ops, 5);
|
||||
return CurDAG->SelectNodeTo(N, PPC::BCC, MVT::Other, Ops);
|
||||
}
|
||||
case ISD::BR_CC: {
|
||||
ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(1))->get();
|
||||
|
@ -1430,7 +1430,7 @@ SDNode *PPCDAGToDAGISel::Select(SDNode *N) {
|
|||
SDValue CondCode = SelectCC(N->getOperand(2), N->getOperand(3), CC, dl);
|
||||
SDValue Ops[] = { getI32Imm(PCC), CondCode,
|
||||
N->getOperand(4), N->getOperand(0) };
|
||||
return CurDAG->SelectNodeTo(N, PPC::BCC, MVT::Other, Ops, 4);
|
||||
return CurDAG->SelectNodeTo(N, PPC::BCC, MVT::Other, Ops);
|
||||
}
|
||||
case ISD::BRIND: {
|
||||
// FIXME: Should custom lower this.
|
||||
|
|
|
@ -246,7 +246,7 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
|
|||
SDValue(AddHi,0),
|
||||
Sub1,
|
||||
};
|
||||
return CurDAG->SelectNodeTo(N, AMDGPU::REG_SEQUENCE, MVT::i64, Args, 5);
|
||||
return CurDAG->SelectNodeTo(N, AMDGPU::REG_SEQUENCE, MVT::i64, Args);
|
||||
}
|
||||
case ISD::BUILD_VECTOR: {
|
||||
unsigned RegClassID;
|
||||
|
@ -315,7 +315,7 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
|
|||
// 16 = Max Num Vector Elements
|
||||
// 2 = 2 REG_SEQUENCE operands per element (value, subreg index)
|
||||
// 1 = Vector Register Class
|
||||
SDValue RegSeqArgs[16 * 2 + 1];
|
||||
SmallVector<SDValue, 16 * 2 + 1> RegSeqArgs(N->getNumOperands() * 2 + 1);
|
||||
|
||||
RegSeqArgs[0] = CurDAG->getTargetConstant(RegClassID, MVT::i32);
|
||||
bool IsRegSeq = true;
|
||||
|
@ -332,7 +332,7 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
|
|||
if (!IsRegSeq)
|
||||
break;
|
||||
return CurDAG->SelectNodeTo(N, AMDGPU::REG_SEQUENCE, N->getVTList(),
|
||||
RegSeqArgs, 2 * N->getNumOperands() + 1);
|
||||
RegSeqArgs);
|
||||
}
|
||||
case ISD::BUILD_PAIR: {
|
||||
SDValue RC, SubReg0, SubReg1;
|
||||
|
|
Loading…
Reference in New Issue