forked from OSchip/llvm-project
Remove non-DebugLoc forms of CopyToReg and CopyFromReg.
Adjust callers. llvm-svn: 63789
This commit is contained in:
parent
ae616c2c61
commit
f08a47bb70
|
@ -322,10 +322,6 @@ public:
|
|||
SDValue getLabel(unsigned Opcode, DebugLoc dl, SDValue Root,
|
||||
unsigned LabelID);
|
||||
|
||||
SDValue getCopyToReg(SDValue Chain, unsigned Reg, SDValue N) {
|
||||
return getNode(ISD::CopyToReg, MVT::Other, Chain,
|
||||
getRegister(Reg, N.getValueType()), N);
|
||||
}
|
||||
SDValue getCopyToReg(SDValue Chain, DebugLoc dl, unsigned Reg, SDValue N) {
|
||||
return getNode(ISD::CopyToReg, dl, MVT::Other, Chain,
|
||||
getRegister(Reg, N.getValueType()), N);
|
||||
|
@ -334,12 +330,6 @@ public:
|
|||
// This version of the getCopyToReg method takes an extra operand, which
|
||||
// indicates that there is potentially an incoming flag value (if Flag is not
|
||||
// null) and that there should be a flag result.
|
||||
SDValue getCopyToReg(SDValue Chain, unsigned Reg, SDValue N,
|
||||
SDValue Flag) {
|
||||
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||
SDValue Ops[] = { Chain, getRegister(Reg, N.getValueType()), N, Flag };
|
||||
return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.getNode() ? 4 : 3);
|
||||
}
|
||||
SDValue getCopyToReg(SDValue Chain, DebugLoc dl, unsigned Reg, SDValue N,
|
||||
SDValue Flag) {
|
||||
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||
|
@ -348,12 +338,6 @@ public:
|
|||
}
|
||||
|
||||
// Similar to last getCopyToReg() except parameter Reg is a SDValue
|
||||
SDValue getCopyToReg(SDValue Chain, SDValue Reg, SDValue N,
|
||||
SDValue Flag) {
|
||||
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||
SDValue Ops[] = { Chain, Reg, N, Flag };
|
||||
return getNode(ISD::CopyToReg, VTs, 2, Ops, Flag.getNode() ? 4 : 3);
|
||||
}
|
||||
SDValue getCopyToReg(SDValue Chain, DebugLoc dl, SDValue Reg, SDValue N,
|
||||
SDValue Flag) {
|
||||
const MVT *VTs = getNodeValueTypes(MVT::Other, MVT::Flag);
|
||||
|
@ -361,11 +345,6 @@ public:
|
|||
return getNode(ISD::CopyToReg, dl, VTs, 2, Ops, Flag.getNode() ? 4 : 3);
|
||||
}
|
||||
|
||||
SDValue getCopyFromReg(SDValue Chain, unsigned Reg, MVT VT) {
|
||||
const MVT *VTs = getNodeValueTypes(VT, MVT::Other);
|
||||
SDValue Ops[] = { Chain, getRegister(Reg, VT) };
|
||||
return getNode(ISD::CopyFromReg, VTs, 2, Ops, 2);
|
||||
}
|
||||
SDValue getCopyFromReg(SDValue Chain, DebugLoc dl, unsigned Reg, MVT VT) {
|
||||
const MVT *VTs = getNodeValueTypes(VT, MVT::Other);
|
||||
SDValue Ops[] = { Chain, getRegister(Reg, VT) };
|
||||
|
@ -375,12 +354,6 @@ public:
|
|||
// This version of the getCopyFromReg method takes an extra operand, which
|
||||
// indicates that there is potentially an incoming flag value (if Flag is not
|
||||
// null) and that there should be a flag result.
|
||||
SDValue getCopyFromReg(SDValue Chain, unsigned Reg, MVT VT,
|
||||
SDValue Flag) {
|
||||
const MVT *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
|
||||
SDValue Ops[] = { Chain, getRegister(Reg, VT), Flag };
|
||||
return getNode(ISD::CopyFromReg, VTs, 3, Ops, Flag.getNode() ? 3 : 2);
|
||||
}
|
||||
SDValue getCopyFromReg(SDValue Chain, DebugLoc dl, unsigned Reg, MVT VT,
|
||||
SDValue Flag) {
|
||||
const MVT *VTs = getNodeValueTypes(VT, MVT::Other, MVT::Flag);
|
||||
|
|
|
@ -4386,7 +4386,7 @@ SDNode *SelectionDAG::MorphNodeTo(SDNode *N, unsigned Opc,
|
|||
///
|
||||
/// Note that MorphNodeTo returns the resultant node. If there is already a
|
||||
/// node of the specified opcode and operands, it returns that node instead of
|
||||
/// the current one.
|
||||
/// the current one. Note that the DebugLoc need not be the same.
|
||||
///
|
||||
/// Using MorphNodeTo is faster than creating a new node and swapping it in
|
||||
/// with ReplaceAllUsesWith both because it often avoids allocating a new
|
||||
|
|
|
@ -652,6 +652,7 @@ SDValue ARMTargetLowering::LowerCALL(SDValue Op, SelectionDAG &DAG) {
|
|||
static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
||||
SDValue Copy;
|
||||
SDValue Chain = Op.getOperand(0);
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
switch(Op.getNumOperands()) {
|
||||
default:
|
||||
assert(0 && "Do not know how to return this many arguments!");
|
||||
|
@ -672,13 +673,14 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
return DAG.getNode(ISD::RET, MVT::Other, Chain, Op, Sign,
|
||||
Op.getValue(1), Sign);
|
||||
}
|
||||
Copy = DAG.getCopyToReg(Chain, ARM::R0, Op, SDValue());
|
||||
Copy = DAG.getCopyToReg(Chain, dl, ARM::R0, Op, SDValue());
|
||||
if (DAG.getMachineFunction().getRegInfo().liveout_empty())
|
||||
DAG.getMachineFunction().getRegInfo().addLiveOut(ARM::R0);
|
||||
break;
|
||||
case 5:
|
||||
Copy = DAG.getCopyToReg(Chain, ARM::R1, Op.getOperand(3), SDValue());
|
||||
Copy = DAG.getCopyToReg(Copy, ARM::R0, Op.getOperand(1), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Chain, dl, ARM::R1, Op.getOperand(3), SDValue());
|
||||
Copy = DAG.getCopyToReg(Copy, dl, ARM::R0, Op.getOperand(1),
|
||||
Copy.getValue(1));
|
||||
// If we haven't noted the R0+R1 are live out, do so now.
|
||||
if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
|
||||
DAG.getMachineFunction().getRegInfo().addLiveOut(ARM::R0);
|
||||
|
@ -686,10 +688,13 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
}
|
||||
break;
|
||||
case 9: // i128 -> 4 regs
|
||||
Copy = DAG.getCopyToReg(Chain, ARM::R3, Op.getOperand(7), SDValue());
|
||||
Copy = DAG.getCopyToReg(Copy , ARM::R2, Op.getOperand(5), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy , ARM::R1, Op.getOperand(3), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy , ARM::R0, Op.getOperand(1), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Chain, dl, ARM::R3, Op.getOperand(7), SDValue());
|
||||
Copy = DAG.getCopyToReg(Copy , dl, ARM::R2, Op.getOperand(5),
|
||||
Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy , dl, ARM::R1, Op.getOperand(3),
|
||||
Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy , dl, ARM::R0, Op.getOperand(1),
|
||||
Copy.getValue(1));
|
||||
// If we haven't noted the R0+R1 are live out, do so now.
|
||||
if (DAG.getMachineFunction().getRegInfo().liveout_empty()) {
|
||||
DAG.getMachineFunction().getRegInfo().addLiveOut(ARM::R0);
|
||||
|
|
|
@ -204,8 +204,9 @@ SDValue AlphaDAGToDAGISel::getGlobalBaseReg() {
|
|||
break;
|
||||
}
|
||||
assert(GP && "GOT PTR not in liveins");
|
||||
// FIXME is there anywhere sensible to get a DebugLoc here?
|
||||
return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
|
||||
GP, MVT::i64);
|
||||
DebugLoc::getUnknownLoc(), GP, MVT::i64);
|
||||
}
|
||||
|
||||
/// getRASaveReg - Grab the return address
|
||||
|
@ -219,8 +220,9 @@ SDValue AlphaDAGToDAGISel::getGlobalRetAddr() {
|
|||
break;
|
||||
}
|
||||
assert(RA && "RA PTR not in liveins");
|
||||
// FIXME is there anywhere sensible to get a DebugLoc here?
|
||||
return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
|
||||
RA, MVT::i64);
|
||||
DebugLoc::getUnknownLoc(), RA, MVT::i64);
|
||||
}
|
||||
|
||||
/// InstructionSelect - This callback is invoked by
|
||||
|
@ -240,6 +242,7 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
if (N->isMachineOpcode()) {
|
||||
return NULL; // Already selected.
|
||||
}
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
|
||||
switch (N->getOpcode()) {
|
||||
default: break;
|
||||
|
@ -269,23 +272,23 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
SDValue N0 = Op.getOperand(0);
|
||||
SDValue N1 = Op.getOperand(1);
|
||||
SDValue N2 = Op.getOperand(2);
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R24, N1,
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R24, N1,
|
||||
SDValue(0,0));
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R25, N2,
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R25, N2,
|
||||
Chain.getValue(1));
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, N0,
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R27, N0,
|
||||
Chain.getValue(1));
|
||||
SDNode *CNode =
|
||||
CurDAG->getTargetNode(Alpha::JSRs, MVT::Other, MVT::Flag,
|
||||
CurDAG->getTargetNode(Alpha::JSRs, dl, MVT::Other, MVT::Flag,
|
||||
Chain, Chain.getValue(1));
|
||||
Chain = CurDAG->getCopyFromReg(Chain, Alpha::R27, MVT::i64,
|
||||
Chain = CurDAG->getCopyFromReg(Chain, dl, Alpha::R27, MVT::i64,
|
||||
SDValue(CNode, 1));
|
||||
return CurDAG->SelectNodeTo(N, Alpha::BISr, MVT::i64, Chain, Chain);
|
||||
}
|
||||
|
||||
case ISD::READCYCLECOUNTER: {
|
||||
SDValue Chain = N->getOperand(0);
|
||||
return CurDAG->getTargetNode(Alpha::RPCC, MVT::i64, MVT::Other,
|
||||
return CurDAG->getTargetNode(Alpha::RPCC, dl, MVT::i64, MVT::Other,
|
||||
Chain);
|
||||
}
|
||||
|
||||
|
@ -293,7 +296,7 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
uint64_t uval = cast<ConstantSDNode>(N)->getZExtValue();
|
||||
|
||||
if (uval == 0) {
|
||||
SDValue Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
|
||||
SDValue Result = CurDAG->getCopyFromReg(CurDAG->getEntryNode(), dl,
|
||||
Alpha::R31, MVT::i64);
|
||||
ReplaceUses(Op, Result);
|
||||
return NULL;
|
||||
|
@ -311,7 +314,7 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
//Else use the constant pool
|
||||
ConstantInt *C = ConstantInt::get(Type::Int64Ty, uval);
|
||||
SDValue CPI = CurDAG->getTargetConstantPool(C, MVT::i64);
|
||||
SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, MVT::i64, CPI,
|
||||
SDNode *Tmp = CurDAG->getTargetNode(Alpha::LDAHr, dl, MVT::i64, CPI,
|
||||
getGlobalBaseReg());
|
||||
return CurDAG->SelectNodeTo(N, Alpha::LDQr, MVT::i64, MVT::Other,
|
||||
CPI, SDValue(Tmp, 0), CurDAG->getEntryNode());
|
||||
|
@ -363,25 +366,27 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
};
|
||||
SDValue tmp1 = N->getOperand(rev?1:0);
|
||||
SDValue tmp2 = N->getOperand(rev?0:1);
|
||||
SDNode *cmp = CurDAG->getTargetNode(Opc, MVT::f64, tmp1, tmp2);
|
||||
SDNode *cmp = CurDAG->getTargetNode(Opc, dl, MVT::f64, tmp1, tmp2);
|
||||
if (inv)
|
||||
cmp = CurDAG->getTargetNode(Alpha::CMPTEQ, MVT::f64, SDValue(cmp, 0),
|
||||
cmp = CurDAG->getTargetNode(Alpha::CMPTEQ, dl,
|
||||
MVT::f64, SDValue(cmp, 0),
|
||||
CurDAG->getRegister(Alpha::F31, MVT::f64));
|
||||
switch(CC) {
|
||||
case ISD::SETUEQ: case ISD::SETULT: case ISD::SETULE:
|
||||
case ISD::SETUNE: case ISD::SETUGT: case ISD::SETUGE:
|
||||
{
|
||||
SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, MVT::f64,
|
||||
SDNode* cmp2 = CurDAG->getTargetNode(Alpha::CMPTUN, dl, MVT::f64,
|
||||
tmp1, tmp2);
|
||||
cmp = CurDAG->getTargetNode(Alpha::ADDT, MVT::f64,
|
||||
cmp = CurDAG->getTargetNode(Alpha::ADDT, dl, MVT::f64,
|
||||
SDValue(cmp2, 0), SDValue(cmp, 0));
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
SDNode* LD = CurDAG->getTargetNode(Alpha::FTOIT, MVT::i64, SDValue(cmp, 0));
|
||||
return CurDAG->getTargetNode(Alpha::CMPULT, MVT::i64,
|
||||
SDNode* LD = CurDAG->getTargetNode(Alpha::FTOIT, dl,
|
||||
MVT::i64, SDValue(cmp, 0));
|
||||
return CurDAG->getTargetNode(Alpha::CMPULT, dl, MVT::i64,
|
||||
CurDAG->getRegister(Alpha::R31, MVT::i64),
|
||||
SDValue(LD,0));
|
||||
}
|
||||
|
@ -400,9 +405,9 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
SDValue TV = N->getOperand(1);
|
||||
SDValue FV = N->getOperand(2);
|
||||
|
||||
SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, MVT::f64, cond);
|
||||
SDNode* LD = CurDAG->getTargetNode(Alpha::ITOFT, dl, MVT::f64, cond);
|
||||
return CurDAG->getTargetNode(isDouble?Alpha::FCMOVNET:Alpha::FCMOVNES,
|
||||
MVT::f64, FV, TV, SDValue(LD,0));
|
||||
dl, MVT::f64, FV, TV, SDValue(LD,0));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -427,10 +432,10 @@ SDNode *AlphaDAGToDAGISel::Select(SDValue Op) {
|
|||
|
||||
if (get_zapImm(mask)) {
|
||||
SDValue Z =
|
||||
SDValue(CurDAG->getTargetNode(Alpha::ZAPNOTi, MVT::i64,
|
||||
SDValue(CurDAG->getTargetNode(Alpha::ZAPNOTi, dl, MVT::i64,
|
||||
N->getOperand(0).getOperand(0),
|
||||
getI64Imm(get_zapImm(mask))), 0);
|
||||
return CurDAG->getTargetNode(Alpha::SRLr, MVT::i64, Z,
|
||||
return CurDAG->getTargetNode(Alpha::SRLr, dl, MVT::i64, Z,
|
||||
getI64Imm(sval));
|
||||
}
|
||||
}
|
||||
|
@ -449,6 +454,7 @@ void AlphaDAGToDAGISel::SelectCALL(SDValue Op) {
|
|||
SDValue Chain = N->getOperand(0);
|
||||
SDValue Addr = N->getOperand(1);
|
||||
SDValue InFlag(0,0); // Null incoming flag value.
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
|
||||
std::vector<SDValue> CallOperands;
|
||||
std::vector<MVT> TypeOperands;
|
||||
|
@ -477,16 +483,18 @@ void AlphaDAGToDAGISel::SelectCALL(SDValue Op) {
|
|||
assert(0 && "Unknown operand");
|
||||
|
||||
SDValue Ops[] = { CallOperands[i], getI64Imm((i - 6) * 8),
|
||||
CurDAG->getCopyFromReg(Chain, Alpha::R30, MVT::i64),
|
||||
Chain };
|
||||
Chain = SDValue(CurDAG->getTargetNode(Opc, MVT::Other, Ops, 4), 0);
|
||||
CurDAG->getCopyFromReg(Chain, dl, Alpha::R30, MVT::i64),
|
||||
Chain };
|
||||
Chain = SDValue(CurDAG->getTargetNode(Opc, dl, MVT::Other, Ops, 4), 0);
|
||||
}
|
||||
for (int i = 0; i < std::min(6, count); ++i) {
|
||||
if (TypeOperands[i].isInteger()) {
|
||||
Chain = CurDAG->getCopyToReg(Chain, args_int[i], CallOperands[i], InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, args_int[i],
|
||||
CallOperands[i], InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
} else if (TypeOperands[i] == MVT::f32 || TypeOperands[i] == MVT::f64) {
|
||||
Chain = CurDAG->getCopyToReg(Chain, args_float[i], CallOperands[i], InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, args_float[i],
|
||||
CallOperands[i], InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
} else
|
||||
assert(0 && "Unknown operand");
|
||||
|
@ -496,15 +504,16 @@ void AlphaDAGToDAGISel::SelectCALL(SDValue Op) {
|
|||
// call itself.
|
||||
if (Addr.getOpcode() == AlphaISD::GPRelLo) {
|
||||
SDValue GOT = getGlobalBaseReg();
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R29, GOT, InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R29, GOT, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
Chain = SDValue(CurDAG->getTargetNode(Alpha::BSR, MVT::Other, MVT::Flag,
|
||||
Addr.getOperand(0), Chain, InFlag), 0);
|
||||
Chain = SDValue(CurDAG->getTargetNode(Alpha::BSR, dl, MVT::Other,
|
||||
MVT::Flag, Addr.getOperand(0),
|
||||
Chain, InFlag), 0);
|
||||
} else {
|
||||
Chain = CurDAG->getCopyToReg(Chain, Alpha::R27, Addr, InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, Alpha::R27, Addr, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
Chain = SDValue(CurDAG->getTargetNode(Alpha::JSR, MVT::Other, MVT::Flag,
|
||||
Chain, InFlag), 0);
|
||||
Chain = SDValue(CurDAG->getTargetNode(Alpha::JSR, dl, MVT::Other,
|
||||
MVT::Flag, Chain, InFlag), 0);
|
||||
}
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
|
@ -514,15 +523,18 @@ void AlphaDAGToDAGISel::SelectCALL(SDValue Op) {
|
|||
default: assert(0 && "Unexpected ret value!");
|
||||
case MVT::Other: break;
|
||||
case MVT::i64:
|
||||
Chain = CurDAG->getCopyFromReg(Chain, Alpha::R0, MVT::i64, InFlag).getValue(1);
|
||||
Chain = CurDAG->getCopyFromReg(Chain, dl,
|
||||
Alpha::R0, MVT::i64, InFlag).getValue(1);
|
||||
CallResults.push_back(Chain.getValue(0));
|
||||
break;
|
||||
case MVT::f32:
|
||||
Chain = CurDAG->getCopyFromReg(Chain, Alpha::F0, MVT::f32, InFlag).getValue(1);
|
||||
Chain = CurDAG->getCopyFromReg(Chain, dl,
|
||||
Alpha::F0, MVT::f32, InFlag).getValue(1);
|
||||
CallResults.push_back(Chain.getValue(0));
|
||||
break;
|
||||
case MVT::f64:
|
||||
Chain = CurDAG->getCopyFromReg(Chain, Alpha::F0, MVT::f64, InFlag).getValue(1);
|
||||
Chain = CurDAG->getCopyFromReg(Chain, dl,
|
||||
Alpha::F0, MVT::f64, InFlag).getValue(1);
|
||||
CallResults.push_back(Chain.getValue(0));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -300,7 +300,8 @@ static SDValue LowerFORMAL_ARGUMENTS(SDValue Op, SelectionDAG &DAG,
|
|||
}
|
||||
|
||||
static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
||||
SDValue Copy = DAG.getCopyToReg(Op.getOperand(0), Alpha::R26,
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
SDValue Copy = DAG.getCopyToReg(Op.getOperand(0), dl, Alpha::R26,
|
||||
DAG.getNode(AlphaISD::GlobalRetAddr,
|
||||
MVT::i64),
|
||||
SDValue());
|
||||
|
@ -320,7 +321,8 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
assert(ArgVT.isFloatingPoint());
|
||||
ArgReg = Alpha::F0;
|
||||
}
|
||||
Copy = DAG.getCopyToReg(Copy, ArgReg, Op.getOperand(1), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy, dl, ArgReg,
|
||||
Op.getOperand(1), Copy.getValue(1));
|
||||
if (DAG.getMachineFunction().getRegInfo().liveout_empty())
|
||||
DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg);
|
||||
break;
|
||||
|
@ -336,12 +338,14 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
ArgReg1 = Alpha::F0;
|
||||
ArgReg2 = Alpha::F1;
|
||||
}
|
||||
Copy = DAG.getCopyToReg(Copy, ArgReg1, Op.getOperand(1), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy, dl, ArgReg1,
|
||||
Op.getOperand(1), Copy.getValue(1));
|
||||
if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(),
|
||||
DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg1)
|
||||
== DAG.getMachineFunction().getRegInfo().liveout_end())
|
||||
DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg1);
|
||||
Copy = DAG.getCopyToReg(Copy, ArgReg2, Op.getOperand(3), Copy.getValue(1));
|
||||
Copy = DAG.getCopyToReg(Copy, dl, ArgReg2,
|
||||
Op.getOperand(3), Copy.getValue(1));
|
||||
if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(),
|
||||
DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg2)
|
||||
== DAG.getMachineFunction().getRegInfo().liveout_end())
|
||||
|
@ -349,7 +353,8 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
return DAG.getNode(AlphaISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1));
|
||||
return DAG.getNode(AlphaISD::RET_FLAG, dl,
|
||||
MVT::Other, Copy, Copy.getValue(1));
|
||||
}
|
||||
|
||||
std::pair<SDValue, SDValue>
|
||||
|
|
|
@ -1292,6 +1292,7 @@ LowerRET(SDValue Op, SelectionDAG &DAG, TargetMachine &TM) {
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||
bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
CCState CCInfo(CC, isVarArg, TM, RVLocs);
|
||||
CCInfo.AnalyzeReturn(Op.getNode(), RetCC_SPU);
|
||||
|
||||
|
@ -1309,14 +1310,15 @@ LowerRET(SDValue Op, SelectionDAG &DAG, TargetMachine &TM) {
|
|||
for (unsigned i = 0; i != RVLocs.size(); ++i) {
|
||||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Op.getOperand(i*2+1), Flag);
|
||||
Flag = Chain.getValue(1);
|
||||
}
|
||||
|
||||
if (Flag.getNode())
|
||||
return DAG.getNode(SPUISD::RET_FLAG, MVT::Other, Chain, Flag);
|
||||
return DAG.getNode(SPUISD::RET_FLAG, dl, MVT::Other, Chain, Flag);
|
||||
else
|
||||
return DAG.getNode(SPUISD::RET_FLAG, MVT::Other, Chain);
|
||||
return DAG.getNode(SPUISD::RET_FLAG, dl, MVT::Other, Chain);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1765,6 +1767,7 @@ static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) {
|
|||
SDValue V1 = Op.getOperand(0);
|
||||
SDValue V2 = Op.getOperand(1);
|
||||
SDValue PermMask = Op.getOperand(2);
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
if (V2.getOpcode() == ISD::UNDEF) V2 = V1;
|
||||
|
||||
|
@ -1839,18 +1842,19 @@ static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) {
|
|||
MVT PtrVT = DAG.getTargetLoweringInfo().getPointerTy();
|
||||
// Initialize temporary register to 0
|
||||
SDValue InitTempReg =
|
||||
DAG.getCopyToReg(DAG.getEntryNode(), VReg, DAG.getConstant(0, PtrVT));
|
||||
DAG.getCopyToReg(DAG.getEntryNode(), dl, VReg, DAG.getConstant(0, PtrVT));
|
||||
// Copy register's contents as index in SHUFFLE_MASK:
|
||||
SDValue ShufMaskOp =
|
||||
DAG.getNode(SPUISD::SHUFFLE_MASK, MVT::v4i32,
|
||||
DAG.getNode(SPUISD::SHUFFLE_MASK, dl, MVT::v4i32,
|
||||
DAG.getTargetConstant(V2Elt, MVT::i32),
|
||||
DAG.getCopyFromReg(InitTempReg, VReg, PtrVT));
|
||||
DAG.getCopyFromReg(InitTempReg, dl, VReg, PtrVT));
|
||||
// Use shuffle mask in SHUFB synthetic instruction:
|
||||
return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V2, V1, ShufMaskOp);
|
||||
return DAG.getNode(SPUISD::SHUFB, dl, V1.getValueType(), V2, V1,
|
||||
ShufMaskOp);
|
||||
} else if (rotate) {
|
||||
int rotamt = (MaxElts - V0Elt) * EltVT.getSizeInBits()/8;
|
||||
|
||||
return DAG.getNode(SPUISD::ROTBYTES_LEFT, V1.getValueType(),
|
||||
return DAG.getNode(SPUISD::ROTBYTES_LEFT, dl, V1.getValueType(),
|
||||
V1, DAG.getConstant(rotamt, MVT::i16));
|
||||
} else {
|
||||
// Convert the SHUFFLE_VECTOR mask's input element units to the
|
||||
|
@ -1871,9 +1875,9 @@ static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) {
|
|||
}
|
||||
}
|
||||
|
||||
SDValue VPermMask = DAG.getNode(ISD::BUILD_VECTOR, MVT::v16i8,
|
||||
SDValue VPermMask = DAG.getNode(ISD::BUILD_VECTOR, dl, MVT::v16i8,
|
||||
&ResultMask[0], ResultMask.size());
|
||||
return DAG.getNode(SPUISD::SHUFB, V1.getValueType(), V1, V2, VPermMask);
|
||||
return DAG.getNode(SPUISD::SHUFB, dl, V1.getValueType(), V1, V2, VPermMask);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2307,6 +2311,7 @@ LowerByteImmed(SDValue Op, SelectionDAG &DAG) {
|
|||
static SDValue LowerCTPOP(SDValue Op, SelectionDAG &DAG) {
|
||||
MVT VT = Op.getValueType();
|
||||
MVT vecVT = MVT::getVectorVT(VT, (128 / VT.getSizeInBits()));
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
switch (VT.getSimpleVT()) {
|
||||
default:
|
||||
|
@ -2315,10 +2320,10 @@ static SDValue LowerCTPOP(SDValue Op, SelectionDAG &DAG) {
|
|||
SDValue N = Op.getOperand(0);
|
||||
SDValue Elt0 = DAG.getConstant(0, MVT::i32);
|
||||
|
||||
SDValue Promote = DAG.getNode(SPUISD::PREFSLOT2VEC, vecVT, N, N);
|
||||
SDValue CNTB = DAG.getNode(SPUISD::CNTB, vecVT, Promote);
|
||||
SDValue Promote = DAG.getNode(SPUISD::PREFSLOT2VEC, dl, vecVT, N, N);
|
||||
SDValue CNTB = DAG.getNode(SPUISD::CNTB, dl, vecVT, Promote);
|
||||
|
||||
return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i8, CNTB, Elt0);
|
||||
return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, MVT::i8, CNTB, Elt0);
|
||||
}
|
||||
|
||||
case MVT::i16: {
|
||||
|
@ -2332,22 +2337,22 @@ static SDValue LowerCTPOP(SDValue Op, SelectionDAG &DAG) {
|
|||
SDValue Mask0 = DAG.getConstant(0x0f, MVT::i16);
|
||||
SDValue Shift1 = DAG.getConstant(8, MVT::i32);
|
||||
|
||||
SDValue Promote = DAG.getNode(SPUISD::PREFSLOT2VEC, vecVT, N, N);
|
||||
SDValue CNTB = DAG.getNode(SPUISD::CNTB, vecVT, Promote);
|
||||
SDValue Promote = DAG.getNode(SPUISD::PREFSLOT2VEC, dl, vecVT, N, N);
|
||||
SDValue CNTB = DAG.getNode(SPUISD::CNTB, dl, vecVT, Promote);
|
||||
|
||||
// CNTB_result becomes the chain to which all of the virtual registers
|
||||
// CNTB_reg, SUM1_reg become associated:
|
||||
SDValue CNTB_result =
|
||||
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i16, CNTB, Elt0);
|
||||
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, MVT::i16, CNTB, Elt0);
|
||||
|
||||
SDValue CNTB_rescopy =
|
||||
DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result);
|
||||
DAG.getCopyToReg(CNTB_result, dl, CNTB_reg, CNTB_result);
|
||||
|
||||
SDValue Tmp1 = DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i16);
|
||||
SDValue Tmp1 = DAG.getCopyFromReg(CNTB_rescopy, dl, CNTB_reg, MVT::i16);
|
||||
|
||||
return DAG.getNode(ISD::AND, MVT::i16,
|
||||
DAG.getNode(ISD::ADD, MVT::i16,
|
||||
DAG.getNode(ISD::SRL, MVT::i16,
|
||||
return DAG.getNode(ISD::AND, dl, MVT::i16,
|
||||
DAG.getNode(ISD::ADD, dl, MVT::i16,
|
||||
DAG.getNode(ISD::SRL, dl, MVT::i16,
|
||||
Tmp1, Shift1),
|
||||
Tmp1),
|
||||
Mask0);
|
||||
|
@ -2366,37 +2371,38 @@ static SDValue LowerCTPOP(SDValue Op, SelectionDAG &DAG) {
|
|||
SDValue Shift1 = DAG.getConstant(16, MVT::i32);
|
||||
SDValue Shift2 = DAG.getConstant(8, MVT::i32);
|
||||
|
||||
SDValue Promote = DAG.getNode(SPUISD::PREFSLOT2VEC, vecVT, N, N);
|
||||
SDValue CNTB = DAG.getNode(SPUISD::CNTB, vecVT, Promote);
|
||||
SDValue Promote = DAG.getNode(SPUISD::PREFSLOT2VEC, dl, vecVT, N, N);
|
||||
SDValue CNTB = DAG.getNode(SPUISD::CNTB, dl, vecVT, Promote);
|
||||
|
||||
// CNTB_result becomes the chain to which all of the virtual registers
|
||||
// CNTB_reg, SUM1_reg become associated:
|
||||
SDValue CNTB_result =
|
||||
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, MVT::i32, CNTB, Elt0);
|
||||
DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, MVT::i32, CNTB, Elt0);
|
||||
|
||||
SDValue CNTB_rescopy =
|
||||
DAG.getCopyToReg(CNTB_result, CNTB_reg, CNTB_result);
|
||||
DAG.getCopyToReg(CNTB_result, dl, CNTB_reg, CNTB_result);
|
||||
|
||||
SDValue Comp1 =
|
||||
DAG.getNode(ISD::SRL, MVT::i32,
|
||||
DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32), Shift1);
|
||||
DAG.getNode(ISD::SRL, dl, MVT::i32,
|
||||
DAG.getCopyFromReg(CNTB_rescopy, dl, CNTB_reg, MVT::i32),
|
||||
Shift1);
|
||||
|
||||
SDValue Sum1 =
|
||||
DAG.getNode(ISD::ADD, MVT::i32,
|
||||
Comp1, DAG.getCopyFromReg(CNTB_rescopy, CNTB_reg, MVT::i32));
|
||||
DAG.getNode(ISD::ADD, dl, MVT::i32, Comp1,
|
||||
DAG.getCopyFromReg(CNTB_rescopy, dl, CNTB_reg, MVT::i32));
|
||||
|
||||
SDValue Sum1_rescopy =
|
||||
DAG.getCopyToReg(CNTB_result, SUM1_reg, Sum1);
|
||||
DAG.getCopyToReg(CNTB_result, dl, SUM1_reg, Sum1);
|
||||
|
||||
SDValue Comp2 =
|
||||
DAG.getNode(ISD::SRL, MVT::i32,
|
||||
DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32),
|
||||
DAG.getNode(ISD::SRL, dl, MVT::i32,
|
||||
DAG.getCopyFromReg(Sum1_rescopy, dl, SUM1_reg, MVT::i32),
|
||||
Shift2);
|
||||
SDValue Sum2 =
|
||||
DAG.getNode(ISD::ADD, MVT::i32, Comp2,
|
||||
DAG.getCopyFromReg(Sum1_rescopy, SUM1_reg, MVT::i32));
|
||||
DAG.getNode(ISD::ADD, dl, MVT::i32, Comp2,
|
||||
DAG.getCopyFromReg(Sum1_rescopy, dl, SUM1_reg, MVT::i32));
|
||||
|
||||
return DAG.getNode(ISD::AND, MVT::i32, Sum2, Mask0);
|
||||
return DAG.getNode(ISD::AND, dl, MVT::i32, Sum2, Mask0);
|
||||
}
|
||||
|
||||
case MVT::i64:
|
||||
|
|
|
@ -300,6 +300,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
SDNode *N = Op.getNode();
|
||||
if (N->isMachineOpcode())
|
||||
return NULL; // Already selected.
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
switch (N->getOpcode()) {
|
||||
default: break;
|
||||
|
@ -334,22 +335,22 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
// load the branch target's entry point [mem] and
|
||||
// GP value [mem+8]
|
||||
SDValue targetEntryPoint=
|
||||
SDValue(CurDAG->getTargetNode(IA64::LD8, MVT::i64, MVT::Other,
|
||||
SDValue(CurDAG->getTargetNode(IA64::LD8, dl, MVT::i64, MVT::Other,
|
||||
FnDescriptor, CurDAG->getEntryNode()), 0);
|
||||
Chain = targetEntryPoint.getValue(1);
|
||||
SDValue targetGPAddr=
|
||||
SDValue(CurDAG->getTargetNode(IA64::ADDS, MVT::i64,
|
||||
SDValue(CurDAG->getTargetNode(IA64::ADDS, dl, MVT::i64,
|
||||
FnDescriptor,
|
||||
CurDAG->getConstant(8, MVT::i64)), 0);
|
||||
Chain = targetGPAddr.getValue(1);
|
||||
SDValue targetGP =
|
||||
SDValue(CurDAG->getTargetNode(IA64::LD8, MVT::i64,MVT::Other,
|
||||
SDValue(CurDAG->getTargetNode(IA64::LD8, dl, MVT::i64,MVT::Other,
|
||||
targetGPAddr, CurDAG->getEntryNode()), 0);
|
||||
Chain = targetGP.getValue(1);
|
||||
|
||||
Chain = CurDAG->getCopyToReg(Chain, IA64::r1, targetGP, InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, IA64::r1, targetGP, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
Chain = CurDAG->getCopyToReg(Chain, IA64::B6,
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, IA64::B6,
|
||||
targetEntryPoint, InFlag); // FLAG these?
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
|
@ -359,11 +360,11 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
|
||||
// Finally, once everything is setup, emit the call itself
|
||||
if (InFlag.getNode())
|
||||
Chain = SDValue(CurDAG->getTargetNode(CallOpcode, MVT::Other, MVT::Flag,
|
||||
CallOperand, InFlag), 0);
|
||||
Chain = SDValue(CurDAG->getTargetNode(CallOpcode, dl, MVT::Other,
|
||||
MVT::Flag, CallOperand, InFlag), 0);
|
||||
else // there might be no arguments
|
||||
Chain = SDValue(CurDAG->getTargetNode(CallOpcode, MVT::Other, MVT::Flag,
|
||||
CallOperand, Chain), 0);
|
||||
Chain = SDValue(CurDAG->getTargetNode(CallOpcode, dl, MVT::Other,
|
||||
MVT::Flag, CallOperand, Chain), 0);
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
std::vector<SDValue> CallResults;
|
||||
|
@ -378,7 +379,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
|
||||
case IA64ISD::GETFD: {
|
||||
SDValue Input = N->getOperand(0);
|
||||
return CurDAG->getTargetNode(IA64::GETFD, MVT::i64, Input);
|
||||
return CurDAG->getTargetNode(IA64::GETFD, dl, MVT::i64, Input);
|
||||
}
|
||||
|
||||
case ISD::FDIV:
|
||||
|
@ -394,10 +395,10 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
SDValue V;
|
||||
ConstantFPSDNode* N2 = cast<ConstantFPSDNode>(N);
|
||||
if (N2->getValueAPF().isPosZero()) {
|
||||
V = CurDAG->getCopyFromReg(Chain, IA64::F0, MVT::f64);
|
||||
V = CurDAG->getCopyFromReg(Chain, dl, IA64::F0, MVT::f64);
|
||||
} else if (N2->isExactlyValue(N2->getValueType(0) == MVT::f32 ?
|
||||
APFloat(+1.0f) : APFloat(+1.0))) {
|
||||
V = CurDAG->getCopyFromReg(Chain, IA64::F1, MVT::f64);
|
||||
V = CurDAG->getCopyFromReg(Chain, dl, IA64::F1, MVT::f64);
|
||||
} else
|
||||
assert(0 && "Unexpected FP constant!");
|
||||
|
||||
|
@ -411,7 +412,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
return CurDAG->SelectNodeTo(N, IA64::MOV, MVT::i64,
|
||||
CurDAG->getTargetFrameIndex(FI, MVT::i64));
|
||||
else
|
||||
return CurDAG->getTargetNode(IA64::MOV, MVT::i64,
|
||||
return CurDAG->getTargetNode(IA64::MOV, dl, MVT::i64,
|
||||
CurDAG->getTargetFrameIndex(FI, MVT::i64));
|
||||
}
|
||||
|
||||
|
@ -421,7 +422,7 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
Constant *C = CP->getConstVal();
|
||||
SDValue CPI = CurDAG->getTargetConstantPool(C, MVT::i64,
|
||||
CP->getAlignment());
|
||||
return CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64, // ?
|
||||
return CurDAG->getTargetNode(IA64::ADDL_GA, dl, MVT::i64, // ?
|
||||
CurDAG->getRegister(IA64::r1, MVT::i64), CPI);
|
||||
}
|
||||
|
||||
|
@ -429,10 +430,10 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
|
||||
SDValue GA = CurDAG->getTargetGlobalAddress(GV, MVT::i64);
|
||||
SDValue Tmp =
|
||||
SDValue(CurDAG->getTargetNode(IA64::ADDL_GA, MVT::i64,
|
||||
SDValue(CurDAG->getTargetNode(IA64::ADDL_GA, dl, MVT::i64,
|
||||
CurDAG->getRegister(IA64::r1,
|
||||
MVT::i64), GA), 0);
|
||||
return CurDAG->getTargetNode(IA64::LD8, MVT::i64, MVT::Other, Tmp,
|
||||
return CurDAG->getTargetNode(IA64::LD8, dl, MVT::i64, MVT::Other, Tmp,
|
||||
CurDAG->getEntryNode());
|
||||
}
|
||||
|
||||
|
@ -441,11 +442,11 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
SDValue EA = CurDAG->getTargetExternalSymbol(
|
||||
cast<ExternalSymbolSDNode>(N)->getSymbol(),
|
||||
MVT::i64);
|
||||
SDValue Tmp = CurDAG->getTargetNode(IA64::ADDL_EA, MVT::i64,
|
||||
SDValue Tmp = CurDAG->getTargetNode(IA64::ADDL_EA, dl, MVT::i64,
|
||||
CurDAG->getRegister(IA64::r1,
|
||||
MVT::i64),
|
||||
EA);
|
||||
return CurDAG->getTargetNode(IA64::LD8, MVT::i64, Tmp);
|
||||
return CurDAG->getTargetNode(IA64::LD8, dl, MVT::i64, Tmp);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -465,9 +466,11 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
case MVT::i1: { // this is a bool
|
||||
Opc = IA64::LD1; // first we load a byte, then compare for != 0
|
||||
if(N->getValueType(0) == MVT::i1) { // XXX: early exit!
|
||||
return CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other,
|
||||
SDValue(CurDAG->getTargetNode(Opc, MVT::i64, Address), 0),
|
||||
CurDAG->getRegister(IA64::r0, MVT::i64),
|
||||
return CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other,
|
||||
SDValue(CurDAG->getTargetNode(Opc, dl,
|
||||
MVT::i64,
|
||||
Address), 0),
|
||||
CurDAG->getRegister(IA64::r0, MVT::i64),
|
||||
Chain);
|
||||
}
|
||||
/* otherwise, we want to load a bool into something bigger: LD1
|
||||
|
@ -499,12 +502,12 @@ SDNode *IA64DAGToDAGISel::Select(SDValue Op) {
|
|||
case MVT::i1: { // this is a bool
|
||||
Opc = IA64::ST1; // we store either 0 or 1 as a byte
|
||||
// first load zero!
|
||||
SDValue Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64);
|
||||
SDValue Initial = CurDAG->getCopyFromReg(Chain, dl, IA64::r0, MVT::i64);
|
||||
Chain = Initial.getValue(1);
|
||||
// then load 1 into the same reg iff the predicate to store is 1
|
||||
SDValue Tmp = ST->getValue();
|
||||
Tmp =
|
||||
SDValue(CurDAG->getTargetNode(IA64::TPCADDS, MVT::i64, Initial,
|
||||
SDValue(CurDAG->getTargetNode(IA64::TPCADDS, dl, MVT::i64, Initial,
|
||||
CurDAG->getTargetConstant(1,
|
||||
MVT::i64),
|
||||
Tmp), 0);
|
||||
|
|
|
@ -197,8 +197,8 @@ void IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG,
|
|||
// FP args go into f8..f15 as needed: (hence the ++)
|
||||
argPreg[count] = args_FP[used_FPArgs++];
|
||||
argOpc[count] = IA64::FMOV;
|
||||
argt = newroot = DAG.getCopyFromReg(DAG.getRoot(), argVreg[count],
|
||||
MVT::f64);
|
||||
argt = newroot = DAG.getCopyFromReg(DAG.getRoot(), dl,
|
||||
argVreg[count], MVT::f64);
|
||||
if (I->getType() == Type::FloatTy)
|
||||
argt = DAG.getNode(ISD::FP_ROUND, dl, MVT::f32, argt,
|
||||
DAG.getIntPtrConstant(0));
|
||||
|
@ -217,7 +217,7 @@ void IA64TargetLowering::LowerArguments(Function &F, SelectionDAG &DAG,
|
|||
argPreg[count] = args_int[count];
|
||||
argOpc[count] = IA64::MOV;
|
||||
argt = newroot =
|
||||
DAG.getCopyFromReg(DAG.getRoot(), argVreg[count], MVT::i64);
|
||||
DAG.getCopyFromReg(DAG.getRoot(), dl, argVreg[count], MVT::i64);
|
||||
if ( getValueType(I->getType()) != MVT::i64)
|
||||
argt = DAG.getNode(ISD::TRUNCATE, dl, getValueType(I->getType()),
|
||||
newroot);
|
||||
|
@ -423,13 +423,16 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
SDValue InFlag;
|
||||
|
||||
// save the current GP, SP and RP : FIXME: do we need to do all 3 always?
|
||||
SDValue GPBeforeCall = DAG.getCopyFromReg(Chain, IA64::r1, MVT::i64, InFlag);
|
||||
SDValue GPBeforeCall = DAG.getCopyFromReg(Chain, dl, IA64::r1,
|
||||
MVT::i64, InFlag);
|
||||
Chain = GPBeforeCall.getValue(1);
|
||||
InFlag = Chain.getValue(2);
|
||||
SDValue SPBeforeCall = DAG.getCopyFromReg(Chain, IA64::r12, MVT::i64, InFlag);
|
||||
SDValue SPBeforeCall = DAG.getCopyFromReg(Chain, dl, IA64::r12,
|
||||
MVT::i64, InFlag);
|
||||
Chain = SPBeforeCall.getValue(1);
|
||||
InFlag = Chain.getValue(2);
|
||||
SDValue RPBeforeCall = DAG.getCopyFromReg(Chain, IA64::rp, MVT::i64, InFlag);
|
||||
SDValue RPBeforeCall = DAG.getCopyFromReg(Chain, dl, IA64::rp,
|
||||
MVT::i64, InFlag);
|
||||
Chain = RPBeforeCall.getValue(1);
|
||||
InFlag = Chain.getValue(2);
|
||||
|
||||
|
@ -444,8 +447,8 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
unsigned seenConverts = 0;
|
||||
for (unsigned i = 0, e = RegValuesToPass.size(); i != e; ++i) {
|
||||
if(RegValuesToPass[i].getValueType().isFloatingPoint()) {
|
||||
Chain = DAG.getCopyToReg(Chain, IntArgRegs[i], Converts[seenConverts++],
|
||||
InFlag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, IntArgRegs[i],
|
||||
Converts[seenConverts++], InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +456,7 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
// next copy args into the usual places, these are flagged
|
||||
unsigned usedFPArgs = 0;
|
||||
for (unsigned i = 0, e = RegValuesToPass.size(); i != e; ++i) {
|
||||
Chain = DAG.getCopyToReg(Chain,
|
||||
Chain = DAG.getCopyToReg(Chain, dl,
|
||||
RegValuesToPass[i].getValueType().isInteger() ?
|
||||
IntArgRegs[i] : FPArgRegs[usedFPArgs++], RegValuesToPass[i], InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
|
@ -486,11 +489,11 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
InFlag = Chain.getValue(1);
|
||||
|
||||
// restore the GP, SP and RP after the call
|
||||
Chain = DAG.getCopyToReg(Chain, IA64::r1, GPBeforeCall, InFlag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, IA64::r1, GPBeforeCall, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
Chain = DAG.getCopyToReg(Chain, IA64::r12, SPBeforeCall, InFlag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, IA64::r12, SPBeforeCall, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
Chain = DAG.getCopyToReg(Chain, IA64::rp, RPBeforeCall, InFlag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, IA64::rp, RPBeforeCall, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
std::vector<MVT> RetVals;
|
||||
|
@ -505,10 +508,12 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
case MVT::i1: { // bools are just like other integers (returned in r8)
|
||||
// we *could* fall through to the truncate below, but this saves a
|
||||
// few redundant predicate ops
|
||||
SDValue boolInR8 = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64,InFlag);
|
||||
SDValue boolInR8 = DAG.getCopyFromReg(Chain, dl, IA64::r8,
|
||||
MVT::i64,InFlag);
|
||||
InFlag = boolInR8.getValue(2);
|
||||
Chain = boolInR8.getValue(1);
|
||||
SDValue zeroReg = DAG.getCopyFromReg(Chain, IA64::r0, MVT::i64, InFlag);
|
||||
SDValue zeroReg = DAG.getCopyFromReg(Chain, dl, IA64::r0,
|
||||
MVT::i64, InFlag);
|
||||
InFlag = zeroReg.getValue(2);
|
||||
Chain = zeroReg.getValue(1);
|
||||
|
||||
|
@ -518,7 +523,7 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
case MVT::i8:
|
||||
case MVT::i16:
|
||||
case MVT::i32:
|
||||
RetVal = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag);
|
||||
RetVal = DAG.getCopyFromReg(Chain, dl, IA64::r8, MVT::i64, InFlag);
|
||||
Chain = RetVal.getValue(1);
|
||||
|
||||
// keep track of whether it is sign or zero extended (todo: bools?)
|
||||
|
@ -529,18 +534,18 @@ IA64TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
RetVal = DAG.getNode(ISD::TRUNCATE, dl, RetTyVT, RetVal);
|
||||
break;
|
||||
case MVT::i64:
|
||||
RetVal = DAG.getCopyFromReg(Chain, IA64::r8, MVT::i64, InFlag);
|
||||
RetVal = DAG.getCopyFromReg(Chain, dl, IA64::r8, MVT::i64, InFlag);
|
||||
Chain = RetVal.getValue(1);
|
||||
InFlag = RetVal.getValue(2); // XXX dead
|
||||
break;
|
||||
case MVT::f32:
|
||||
RetVal = DAG.getCopyFromReg(Chain, IA64::F8, MVT::f64, InFlag);
|
||||
RetVal = DAG.getCopyFromReg(Chain, dl, IA64::F8, MVT::f64, InFlag);
|
||||
Chain = RetVal.getValue(1);
|
||||
RetVal = DAG.getNode(ISD::FP_ROUND, dl, MVT::f32, RetVal,
|
||||
DAG.getIntPtrConstant(0));
|
||||
break;
|
||||
case MVT::f64:
|
||||
RetVal = DAG.getCopyFromReg(Chain, IA64::F8, MVT::f64, InFlag);
|
||||
RetVal = DAG.getCopyFromReg(Chain, dl, IA64::F8, MVT::f64, InFlag);
|
||||
Chain = RetVal.getValue(1);
|
||||
InFlag = RetVal.getValue(2); // XXX dead
|
||||
break;
|
||||
|
|
|
@ -126,8 +126,9 @@ SDValue MipsDAGToDAGISel::getGlobalBaseReg() {
|
|||
break;
|
||||
}
|
||||
assert(GP && "GOT PTR not in liveins");
|
||||
// FIXME is there a sensible place to get debug info for this?
|
||||
return CurDAG->getCopyFromReg(CurDAG->getEntryNode(),
|
||||
GP, MVT::i32);
|
||||
DebugLoc::getUnknownLoc(), GP, MVT::i32);
|
||||
}
|
||||
|
||||
/// ComplexPattern used on MipsInstrInfo
|
||||
|
@ -187,6 +188,7 @@ Select(SDValue N)
|
|||
{
|
||||
SDNode *Node = N.getNode();
|
||||
unsigned Opcode = Node->getOpcode();
|
||||
DebugLoc dl = Node->getDebugLoc();
|
||||
|
||||
// Dump information about the Node being selected
|
||||
#ifndef NDEBUG
|
||||
|
@ -238,8 +240,8 @@ Select(SDValue N)
|
|||
SDValue RHS = Node->getOperand(1);
|
||||
|
||||
MVT VT = LHS.getValueType();
|
||||
SDNode *Carry = CurDAG->getTargetNode(Mips::SLTu, VT, Ops, 2);
|
||||
SDNode *AddCarry = CurDAG->getTargetNode(Mips::ADDu, VT,
|
||||
SDNode *Carry = CurDAG->getTargetNode(Mips::SLTu, dl, VT, Ops, 2);
|
||||
SDNode *AddCarry = CurDAG->getTargetNode(Mips::ADDu, dl, VT,
|
||||
SDValue(Carry,0), RHS);
|
||||
|
||||
return CurDAG->SelectNodeTo(N.getNode(), MOp, VT, MVT::Flag,
|
||||
|
@ -260,13 +262,13 @@ Select(SDValue N)
|
|||
else
|
||||
Op = (Opcode == ISD::UDIVREM ? Mips::DIVu : Mips::DIV);
|
||||
|
||||
SDNode *Node = CurDAG->getTargetNode(Op, MVT::Flag, Op1, Op2);
|
||||
SDNode *Node = CurDAG->getTargetNode(Op, dl, MVT::Flag, Op1, Op2);
|
||||
|
||||
SDValue InFlag = SDValue(Node, 0);
|
||||
SDNode *Lo = CurDAG->getTargetNode(Mips::MFLO, MVT::i32,
|
||||
SDNode *Lo = CurDAG->getTargetNode(Mips::MFLO, dl, MVT::i32,
|
||||
MVT::Flag, InFlag);
|
||||
InFlag = SDValue(Lo,1);
|
||||
SDNode *Hi = CurDAG->getTargetNode(Mips::MFHI, MVT::i32, InFlag);
|
||||
SDNode *Hi = CurDAG->getTargetNode(Mips::MFHI, dl, MVT::i32, InFlag);
|
||||
|
||||
if (!N.getValue(0).use_empty())
|
||||
ReplaceUses(N.getValue(0), SDValue(Lo,0));
|
||||
|
@ -285,14 +287,15 @@ Select(SDValue N)
|
|||
SDValue MulOp2 = Node->getOperand(1);
|
||||
|
||||
unsigned MulOp = (Opcode == ISD::MULHU ? Mips::MULTu : Mips::MULT);
|
||||
SDNode *MulNode = CurDAG->getTargetNode(MulOp, MVT::Flag, MulOp1, MulOp2);
|
||||
SDNode *MulNode = CurDAG->getTargetNode(MulOp, dl,
|
||||
MVT::Flag, MulOp1, MulOp2);
|
||||
|
||||
SDValue InFlag = SDValue(MulNode, 0);
|
||||
|
||||
if (MulOp == ISD::MUL)
|
||||
return CurDAG->getTargetNode(Mips::MFLO, MVT::i32, InFlag);
|
||||
return CurDAG->getTargetNode(Mips::MFLO, dl, MVT::i32, InFlag);
|
||||
else
|
||||
return CurDAG->getTargetNode(Mips::MFHI, MVT::i32, InFlag);
|
||||
return CurDAG->getTargetNode(Mips::MFHI, dl, MVT::i32, InFlag);
|
||||
}
|
||||
|
||||
/// Div/Rem operations
|
||||
|
@ -311,10 +314,10 @@ Select(SDValue N)
|
|||
Op = (Opcode == ISD::SREM ? Mips::DIV : Mips::DIVu);
|
||||
MOp = Mips::MFHI;
|
||||
}
|
||||
SDNode *Node = CurDAG->getTargetNode(Op, MVT::Flag, Op1, Op2);
|
||||
SDNode *Node = CurDAG->getTargetNode(Op, dl, MVT::Flag, Op1, Op2);
|
||||
|
||||
SDValue InFlag = SDValue(Node, 0);
|
||||
return CurDAG->getTargetNode(MOp, MVT::i32, InFlag);
|
||||
return CurDAG->getTargetNode(MOp, dl, MVT::i32, InFlag);
|
||||
}
|
||||
|
||||
// Get target GOT address.
|
||||
|
@ -344,18 +347,18 @@ Select(SDValue N)
|
|||
|
||||
// Use load to get GOT target
|
||||
SDValue Ops[] = { Callee, GPReg, Chain };
|
||||
SDValue Load = SDValue(CurDAG->getTargetNode(Mips::LW, MVT::i32,
|
||||
SDValue Load = SDValue(CurDAG->getTargetNode(Mips::LW, dl, MVT::i32,
|
||||
MVT::Other, Ops, 3), 0);
|
||||
Chain = Load.getValue(1);
|
||||
|
||||
// Call target must be on T9
|
||||
Chain = CurDAG->getCopyToReg(Chain, T9Reg, Load, InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, T9Reg, Load, InFlag);
|
||||
} else
|
||||
/// Indirect call
|
||||
Chain = CurDAG->getCopyToReg(Chain, T9Reg, Callee, InFlag);
|
||||
Chain = CurDAG->getCopyToReg(Chain, dl, T9Reg, Callee, InFlag);
|
||||
|
||||
// Emit Jump and Link Register
|
||||
SDNode *ResNode = CurDAG->getTargetNode(Mips::JALR, MVT::Other,
|
||||
SDNode *ResNode = CurDAG->getTargetNode(Mips::JALR, dl, MVT::Other,
|
||||
MVT::Flag, T9Reg, Chain);
|
||||
Chain = SDValue(ResNode, 0);
|
||||
InFlag = SDValue(ResNode, 1);
|
||||
|
|
|
@ -367,22 +367,23 @@ LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG)
|
|||
{
|
||||
SDValue Chain = Op.getOperand(0);
|
||||
SDValue Size = Op.getOperand(1);
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
// Get a reference from Mips stack pointer
|
||||
SDValue StackPointer = DAG.getCopyFromReg(Chain, Mips::SP, MVT::i32);
|
||||
SDValue StackPointer = DAG.getCopyFromReg(Chain, dl, Mips::SP, MVT::i32);
|
||||
|
||||
// Subtract the dynamic size from the actual stack size to
|
||||
// obtain the new stack size.
|
||||
SDValue Sub = DAG.getNode(ISD::SUB, MVT::i32, StackPointer, Size);
|
||||
SDValue Sub = DAG.getNode(ISD::SUB, dl, MVT::i32, StackPointer, Size);
|
||||
|
||||
// The Sub result contains the new stack start address, so it
|
||||
// must be placed in the stack pointer register.
|
||||
Chain = DAG.getCopyToReg(StackPointer.getValue(1), Mips::SP, Sub);
|
||||
Chain = DAG.getCopyToReg(StackPointer.getValue(1), dl, Mips::SP, Sub);
|
||||
|
||||
// This node always has two return values: a new stack pointer
|
||||
// value and a chain
|
||||
SDValue Ops[2] = { Sub, Chain };
|
||||
return DAG.getMergeValues(Ops, 2);
|
||||
return DAG.getMergeValues(Ops, 2, dl);
|
||||
}
|
||||
|
||||
SDValue MipsTargetLowering::
|
||||
|
@ -942,6 +943,7 @@ LowerRET(SDValue Op, SelectionDAG &DAG)
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||
bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CC, isVarArg, getTargetMachine(), RVLocs);
|
||||
|
@ -968,7 +970,8 @@ LowerRET(SDValue Op, SelectionDAG &DAG)
|
|||
|
||||
// ISD::RET => ret chain, (regnum1,val1), ...
|
||||
// So i*2+1 index only the regnums
|
||||
Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Op.getOperand(i*2+1), Flag);
|
||||
|
||||
// guarantee that all emitted copies are
|
||||
// stuck together, avoiding something bad
|
||||
|
@ -986,18 +989,18 @@ LowerRET(SDValue Op, SelectionDAG &DAG)
|
|||
|
||||
if (!Reg)
|
||||
assert(0 && "sret virtual register not created in the entry block");
|
||||
SDValue Val = DAG.getCopyFromReg(Chain, Reg, getPointerTy());
|
||||
SDValue Val = DAG.getCopyFromReg(Chain, dl, Reg, getPointerTy());
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, Mips::V0, Val, Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, Mips::V0, Val, Flag);
|
||||
Flag = Chain.getValue(1);
|
||||
}
|
||||
|
||||
// Return on Mips is always a "jr $ra"
|
||||
if (Flag.getNode())
|
||||
return DAG.getNode(MipsISD::Ret, MVT::Other,
|
||||
return DAG.getNode(MipsISD::Ret, dl, MVT::Other,
|
||||
Chain, DAG.getRegister(Mips::RA, MVT::i32), Flag);
|
||||
else // Return Void
|
||||
return DAG.getNode(MipsISD::Ret, MVT::Other,
|
||||
return DAG.getNode(MipsISD::Ret, dl, MVT::Other,
|
||||
Chain, DAG.getRegister(Mips::RA, MVT::i32));
|
||||
}
|
||||
|
||||
|
|
|
@ -652,6 +652,7 @@ static unsigned getCRIdxForSetCC(ISD::CondCode CC, bool &Invert, int &Other) {
|
|||
|
||||
SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
||||
SDNode *N = Op.getNode();
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
unsigned Imm;
|
||||
ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(2))->get();
|
||||
if (isInt32Immediate(N->getOperand(1), Imm)) {
|
||||
|
@ -663,13 +664,13 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
|||
switch (CC) {
|
||||
default: break;
|
||||
case ISD::SETEQ: {
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::CNTLZW, MVT::i32, Op), 0);
|
||||
Op = SDValue(CurDAG->getTargetNode(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);
|
||||
}
|
||||
case ISD::SETNE: {
|
||||
SDValue AD =
|
||||
SDValue(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
|
||||
SDValue(CurDAG->getTargetNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
|
||||
Op, getI32Imm(~0U)), 0);
|
||||
return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, AD, Op,
|
||||
AD.getValue(1));
|
||||
|
@ -680,8 +681,8 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
|||
}
|
||||
case ISD::SETGT: {
|
||||
SDValue T =
|
||||
SDValue(CurDAG->getTargetNode(PPC::NEG, MVT::i32, Op), 0);
|
||||
T = SDValue(CurDAG->getTargetNode(PPC::ANDC, MVT::i32, T, Op), 0);
|
||||
SDValue(CurDAG->getTargetNode(PPC::NEG, dl, MVT::i32, Op), 0);
|
||||
T = SDValue(CurDAG->getTargetNode(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);
|
||||
}
|
||||
|
@ -691,30 +692,32 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
|||
switch (CC) {
|
||||
default: break;
|
||||
case ISD::SETEQ:
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
|
||||
Op, getI32Imm(1)), 0);
|
||||
return CurDAG->SelectNodeTo(N, PPC::ADDZE, MVT::i32,
|
||||
SDValue(CurDAG->getTargetNode(PPC::LI, MVT::i32,
|
||||
getI32Imm(0)), 0),
|
||||
Op.getValue(1));
|
||||
SDValue(CurDAG->getTargetNode(PPC::LI, dl,
|
||||
MVT::i32,
|
||||
getI32Imm(0)), 0),
|
||||
Op.getValue(1));
|
||||
case ISD::SETNE: {
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::NOR, MVT::i32, Op, Op), 0);
|
||||
SDNode *AD = CurDAG->getTargetNode(PPC::ADDIC, MVT::i32, MVT::Flag,
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::NOR, dl, MVT::i32, Op, Op), 0);
|
||||
SDNode *AD = CurDAG->getTargetNode(PPC::ADDIC, dl, MVT::i32, MVT::Flag,
|
||||
Op, getI32Imm(~0U));
|
||||
return CurDAG->SelectNodeTo(N, PPC::SUBFE, MVT::i32, SDValue(AD, 0),
|
||||
Op, SDValue(AD, 1));
|
||||
}
|
||||
case ISD::SETLT: {
|
||||
SDValue AD = SDValue(CurDAG->getTargetNode(PPC::ADDI, MVT::i32, Op,
|
||||
SDValue AD = SDValue(CurDAG->getTargetNode(PPC::ADDI, dl, MVT::i32, Op,
|
||||
getI32Imm(1)), 0);
|
||||
SDValue AN = SDValue(CurDAG->getTargetNode(PPC::AND, MVT::i32, AD,
|
||||
SDValue AN = SDValue(CurDAG->getTargetNode(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);
|
||||
}
|
||||
case ISD::SETGT: {
|
||||
SDValue Ops[] = { Op, getI32Imm(1), getI32Imm(31), getI32Imm(31) };
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0);
|
||||
Op = SDValue(CurDAG->getTargetNode(PPC::RLWINM, dl, MVT::i32, Ops, 4),
|
||||
0);
|
||||
return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Op,
|
||||
getI32Imm(1));
|
||||
}
|
||||
|
@ -732,14 +735,14 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
|||
SDValue CR7Reg = CurDAG->getRegister(PPC::CR7, MVT::i32);
|
||||
|
||||
SDValue InFlag(0, 0); // Null incoming flag value.
|
||||
CCReg = CurDAG->getCopyToReg(CurDAG->getEntryNode(), CR7Reg, CCReg,
|
||||
CCReg = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, CR7Reg, CCReg,
|
||||
InFlag).getValue(1);
|
||||
|
||||
if (PPCSubTarget.isGigaProcessor() && OtherCondIdx == -1)
|
||||
IntCR = SDValue(CurDAG->getTargetNode(PPC::MFOCRF, MVT::i32, CR7Reg,
|
||||
IntCR = SDValue(CurDAG->getTargetNode(PPC::MFOCRF, dl, MVT::i32, CR7Reg,
|
||||
CCReg), 0);
|
||||
else
|
||||
IntCR = SDValue(CurDAG->getTargetNode(PPC::MFCR, MVT::i32, CCReg), 0);
|
||||
IntCR = SDValue(CurDAG->getTargetNode(PPC::MFCR, dl, MVT::i32, CCReg), 0);
|
||||
|
||||
SDValue Ops[] = { IntCR, getI32Imm((32-(3-Idx)) & 31),
|
||||
getI32Imm(31), getI32Imm(31) };
|
||||
|
@ -748,7 +751,7 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
|||
|
||||
// Get the specified bit.
|
||||
SDValue Tmp =
|
||||
SDValue(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0);
|
||||
SDValue(CurDAG->getTargetNode(PPC::RLWINM, dl, MVT::i32, Ops, 4), 0);
|
||||
if (Inv) {
|
||||
assert(OtherCondIdx == -1 && "Can't have split plus negation");
|
||||
return CurDAG->SelectNodeTo(N, PPC::XORI, MVT::i32, Tmp, getI32Imm(1));
|
||||
|
@ -760,7 +763,7 @@ SDNode *PPCDAGToDAGISel::SelectSETCC(SDValue Op) {
|
|||
// Get the other bit of the comparison.
|
||||
Ops[1] = getI32Imm((32-(3-OtherCondIdx)) & 31);
|
||||
SDValue OtherCond =
|
||||
SDValue(CurDAG->getTargetNode(PPC::RLWINM, MVT::i32, Ops, 4), 0);
|
||||
SDValue(CurDAG->getTargetNode(PPC::RLWINM, dl, MVT::i32, Ops, 4), 0);
|
||||
|
||||
return CurDAG->SelectNodeTo(N, PPC::OR, MVT::i32, Tmp, OtherCond);
|
||||
}
|
||||
|
|
|
@ -2625,6 +2625,7 @@ SDValue PPCTargetLowering::LowerRET(SDValue Op, SelectionDAG &DAG,
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||
bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
CCState CCInfo(CC, isVarArg, TM, RVLocs);
|
||||
CCInfo.AnalyzeReturn(Op.getNode(), RetCC_PPC);
|
||||
|
||||
|
@ -2662,7 +2663,7 @@ SDValue PPCTargetLowering::LowerRET(SDValue Op, SelectionDAG &DAG,
|
|||
for (unsigned i=3; i < TailCall.getNumOperands()-1; i++) {
|
||||
Operands.push_back(Chain.getOperand(i));
|
||||
}
|
||||
return DAG.getNode(PPCISD::TC_RETURN, MVT::Other, &Operands[0],
|
||||
return DAG.getNode(PPCISD::TC_RETURN, dl, MVT::Other, &Operands[0],
|
||||
Operands.size());
|
||||
}
|
||||
|
||||
|
@ -2672,14 +2673,15 @@ SDValue PPCTargetLowering::LowerRET(SDValue Op, SelectionDAG &DAG,
|
|||
for (unsigned i = 0; i != RVLocs.size(); ++i) {
|
||||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Op.getOperand(i*2+1), Flag);
|
||||
Flag = Chain.getValue(1);
|
||||
}
|
||||
|
||||
if (Flag.getNode())
|
||||
return DAG.getNode(PPCISD::RET_FLAG, MVT::Other, Chain, Flag);
|
||||
return DAG.getNode(PPCISD::RET_FLAG, dl, MVT::Other, Chain, Flag);
|
||||
else
|
||||
return DAG.getNode(PPCISD::RET_FLAG, MVT::Other, Chain);
|
||||
return DAG.getNode(PPCISD::RET_FLAG, dl, MVT::Other, Chain);
|
||||
}
|
||||
|
||||
SDValue PPCTargetLowering::LowerSTACKRESTORE(SDValue Op, SelectionDAG &DAG,
|
||||
|
@ -4925,6 +4927,7 @@ SDValue PPCTargetLowering::LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) {
|
|||
}
|
||||
|
||||
SDValue PPCTargetLowering::LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) {
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
// Depths > 0 not supported yet!
|
||||
if (cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue() > 0)
|
||||
return SDValue();
|
||||
|
@ -4938,10 +4941,10 @@ SDValue PPCTargetLowering::LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) {
|
|||
&& MFI->getStackSize();
|
||||
|
||||
if (isPPC64)
|
||||
return DAG.getCopyFromReg(DAG.getEntryNode(), is31 ? PPC::X31 : PPC::X1,
|
||||
return DAG.getCopyFromReg(DAG.getEntryNode(), dl, is31 ? PPC::X31 : PPC::X1,
|
||||
MVT::i64);
|
||||
else
|
||||
return DAG.getCopyFromReg(DAG.getEntryNode(), is31 ? PPC::R31 : PPC::R1,
|
||||
return DAG.getCopyFromReg(DAG.getEntryNode(), dl, is31 ? PPC::R31 : PPC::R1,
|
||||
MVT::i32);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||
bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CC, isVarArg, DAG.getTarget(), RVLocs);
|
||||
|
@ -61,15 +62,16 @@ static SDValue LowerRET(SDValue Op, SelectionDAG &DAG) {
|
|||
|
||||
// ISD::RET => ret chain, (regnum1,val1), ...
|
||||
// So i*2+1 index only the regnums.
|
||||
Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Op.getOperand(i*2+1), Flag);
|
||||
|
||||
// Guarantee that all emitted copies are stuck together with flags.
|
||||
Flag = Chain.getValue(1);
|
||||
}
|
||||
|
||||
if (Flag.getNode())
|
||||
return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Chain, Flag);
|
||||
return DAG.getNode(SPISD::RET_FLAG, MVT::Other, Chain);
|
||||
return DAG.getNode(SPISD::RET_FLAG, dl, MVT::Other, Chain, Flag);
|
||||
return DAG.getNode(SPISD::RET_FLAG, dl, MVT::Other, Chain);
|
||||
}
|
||||
|
||||
/// LowerArguments - V8 uses a very simple ABI, where all values are passed in
|
||||
|
@ -871,18 +873,19 @@ static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) {
|
|||
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) {
|
||||
SDValue Chain = Op.getOperand(0); // Legalize the chain.
|
||||
SDValue Size = Op.getOperand(1); // Legalize the size.
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
unsigned SPReg = SP::O6;
|
||||
SDValue SP = DAG.getCopyFromReg(Chain, SPReg, MVT::i32);
|
||||
SDValue NewSP = DAG.getNode(ISD::SUB, MVT::i32, SP, Size); // Value
|
||||
Chain = DAG.getCopyToReg(SP.getValue(1), SPReg, NewSP); // Output chain
|
||||
SDValue SP = DAG.getCopyFromReg(Chain, dl, SPReg, MVT::i32);
|
||||
SDValue NewSP = DAG.getNode(ISD::SUB, dl, MVT::i32, SP, Size); // Value
|
||||
Chain = DAG.getCopyToReg(SP.getValue(1), dl, SPReg, NewSP); // Output chain
|
||||
|
||||
// The resultant pointer is actually 16 words from the bottom of the stack,
|
||||
// to provide a register spill area.
|
||||
SDValue NewVal = DAG.getNode(ISD::ADD, MVT::i32, NewSP,
|
||||
SDValue NewVal = DAG.getNode(ISD::ADD, dl, MVT::i32, NewSP,
|
||||
DAG.getConstant(96, MVT::i32));
|
||||
SDValue Ops[2] = { NewVal, Chain };
|
||||
return DAG.getMergeValues(Ops, 2);
|
||||
return DAG.getMergeValues(Ops, 2, dl);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -369,14 +369,15 @@ LowerVASTART(SDValue Op, SelectionDAG &DAG)
|
|||
}
|
||||
|
||||
SDValue XCoreTargetLowering::LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) {
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
// Depths > 0 not supported yet!
|
||||
if (cast<ConstantSDNode>(Op.getOperand(0))->getZExtValue() > 0)
|
||||
return SDValue();
|
||||
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
const TargetRegisterInfo *RegInfo = getTargetMachine().getRegisterInfo();
|
||||
return DAG.getCopyFromReg(DAG.getEntryNode(), RegInfo->getFrameRegister(MF),
|
||||
MVT::i32);
|
||||
return DAG.getCopyFromReg(DAG.getEntryNode(), dl,
|
||||
RegInfo->getFrameRegister(MF), MVT::i32);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -424,6 +425,7 @@ LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
|||
SDValue Chain = TheCall->getChain();
|
||||
SDValue Callee = TheCall->getCallee();
|
||||
bool isVarArg = TheCall->isVarArg();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
|
@ -456,13 +458,13 @@ LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
|||
default: assert(0 && "Unknown loc info!");
|
||||
case CCValAssign::Full: break;
|
||||
case CCValAssign::SExt:
|
||||
Arg = DAG.getNode(ISD::SIGN_EXTEND, VA.getLocVT(), Arg);
|
||||
Arg = DAG.getNode(ISD::SIGN_EXTEND, dl, VA.getLocVT(), Arg);
|
||||
break;
|
||||
case CCValAssign::ZExt:
|
||||
Arg = DAG.getNode(ISD::ZERO_EXTEND, VA.getLocVT(), Arg);
|
||||
Arg = DAG.getNode(ISD::ZERO_EXTEND, dl, VA.getLocVT(), Arg);
|
||||
break;
|
||||
case CCValAssign::AExt:
|
||||
Arg = DAG.getNode(ISD::ANY_EXTEND, VA.getLocVT(), Arg);
|
||||
Arg = DAG.getNode(ISD::ANY_EXTEND, dl, VA.getLocVT(), Arg);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -475,7 +477,8 @@ LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
|||
|
||||
int Offset = VA.getLocMemOffset();
|
||||
|
||||
MemOpChains.push_back(DAG.getNode(XCoreISD::STWSP, MVT::Other, Chain, Arg,
|
||||
MemOpChains.push_back(DAG.getNode(XCoreISD::STWSP, dl, MVT::Other,
|
||||
Chain, Arg,
|
||||
DAG.getConstant(Offset/4, MVT::i32)));
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +486,7 @@ LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
|||
// Transform all store nodes into one single node because
|
||||
// all store nodes are independent of each other.
|
||||
if (!MemOpChains.empty())
|
||||
Chain = DAG.getNode(ISD::TokenFactor, MVT::Other,
|
||||
Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
|
||||
&MemOpChains[0], MemOpChains.size());
|
||||
|
||||
// Build a sequence of copy-to-reg nodes chained together with token
|
||||
|
@ -492,7 +495,7 @@ LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
|||
// stuck together.
|
||||
SDValue InFlag;
|
||||
for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
|
||||
Chain = DAG.getCopyToReg(Chain, RegsToPass[i].first,
|
||||
Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
|
||||
RegsToPass[i].second, InFlag);
|
||||
InFlag = Chain.getValue(1);
|
||||
}
|
||||
|
@ -523,7 +526,7 @@ LowerCCCCallTo(SDValue Op, SelectionDAG &DAG, unsigned CC)
|
|||
if (InFlag.getNode())
|
||||
Ops.push_back(InFlag);
|
||||
|
||||
Chain = DAG.getNode(XCoreISD::BL, NodeTys, &Ops[0], Ops.size());
|
||||
Chain = DAG.getNode(XCoreISD::BL, dl, NodeTys, &Ops[0], Ops.size());
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
// Create the CALLSEQ_END node.
|
||||
|
@ -548,6 +551,7 @@ SDNode *XCoreTargetLowering::
|
|||
LowerCallResult(SDValue Chain, SDValue InFlag, CallSDNode *TheCall,
|
||||
unsigned CallingConv, SelectionDAG &DAG) {
|
||||
bool isVarArg = TheCall->isVarArg();
|
||||
DebugLoc dl = TheCall->getDebugLoc();
|
||||
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
@ -558,7 +562,7 @@ LowerCallResult(SDValue Chain, SDValue InFlag, CallSDNode *TheCall,
|
|||
|
||||
// Copy all of the result registers out of their specified physreg.
|
||||
for (unsigned i = 0; i != RVLocs.size(); ++i) {
|
||||
Chain = DAG.getCopyFromReg(Chain, RVLocs[i].getLocReg(),
|
||||
Chain = DAG.getCopyFromReg(Chain, dl, RVLocs[i].getLocReg(),
|
||||
RVLocs[i].getValVT(), InFlag).getValue(1);
|
||||
InFlag = Chain.getValue(2);
|
||||
ResultVals.push_back(Chain.getValue(0));
|
||||
|
@ -567,7 +571,7 @@ LowerCallResult(SDValue Chain, SDValue InFlag, CallSDNode *TheCall,
|
|||
ResultVals.push_back(Chain);
|
||||
|
||||
// Merge everything together with a MERGE_VALUES node.
|
||||
return DAG.getNode(ISD::MERGE_VALUES, TheCall->getVTList(),
|
||||
return DAG.getNode(ISD::MERGE_VALUES, dl, TheCall->getVTList(),
|
||||
&ResultVals[0], ResultVals.size()).getNode();
|
||||
}
|
||||
|
||||
|
@ -718,6 +722,7 @@ LowerRET(SDValue Op, SelectionDAG &DAG)
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
unsigned CC = DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||
bool isVarArg = DAG.getMachineFunction().getFunction()->isVarArg();
|
||||
DebugLoc dl = Op.getDebugLoc();
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CC, isVarArg, getTargetMachine(), RVLocs);
|
||||
|
@ -744,7 +749,8 @@ LowerRET(SDValue Op, SelectionDAG &DAG)
|
|||
|
||||
// ISD::RET => ret chain, (regnum1,val1), ...
|
||||
// So i*2+1 index only the regnums
|
||||
Chain = DAG.getCopyToReg(Chain, VA.getLocReg(), Op.getOperand(i*2+1), Flag);
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Op.getOperand(i*2+1), Flag);
|
||||
|
||||
// guarantee that all emitted copies are
|
||||
// stuck together, avoiding something bad
|
||||
|
@ -753,10 +759,10 @@ LowerRET(SDValue Op, SelectionDAG &DAG)
|
|||
|
||||
// Return on XCore is always a "retsp 0"
|
||||
if (Flag.getNode())
|
||||
return DAG.getNode(XCoreISD::RETSP, MVT::Other,
|
||||
return DAG.getNode(XCoreISD::RETSP, dl, MVT::Other,
|
||||
Chain, DAG.getConstant(0, MVT::i32), Flag);
|
||||
else // Return Void
|
||||
return DAG.getNode(XCoreISD::RETSP, MVT::Other,
|
||||
return DAG.getNode(XCoreISD::RETSP, dl, MVT::Other,
|
||||
Chain, DAG.getConstant(0, MVT::i32));
|
||||
}
|
||||
|
||||
|
|
|
@ -1395,6 +1395,7 @@ private:
|
|||
}
|
||||
std::string Decl = (!ResNodeDecled) ? "SDNode *" : "";
|
||||
emitCode(Decl + "ResNode = CurDAG->getCopyToReg(" + ChainName +
|
||||
", " + RootName + ".getDebugLoc()" +
|
||||
", " + getQualifiedName(RR) +
|
||||
", " + RootName + utostr(OpNo) + ", InFlag).getNode();");
|
||||
ResNodeDecled = true;
|
||||
|
|
Loading…
Reference in New Issue