mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Revert "[DebugInfo] Add debug locations to constant SD nodes"
This breaks a test: http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/23870 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235987 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -544,7 +544,7 @@ static SDValue createFPCmp(SelectionDAG &DAG, const SDValue &Op) {
|
||||
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(2))->get();
|
||||
|
||||
return DAG.getNode(MipsISD::FPCmp, DL, MVT::Glue, LHS, RHS,
|
||||
DAG.getConstant(condCodeToFCC(CC), DL, MVT::i32));
|
||||
DAG.getConstant(condCodeToFCC(CC), MVT::i32));
|
||||
}
|
||||
|
||||
// Creates and returns a CMovFPT/F node.
|
||||
@@ -699,11 +699,9 @@ static SDValue performANDCombine(SDNode *N, SelectionDAG &DAG,
|
||||
if (SMPos != 0 || Pos + SMSize > ValTy.getSizeInBits())
|
||||
return SDValue();
|
||||
|
||||
SDLoc DL(N);
|
||||
return DAG.getNode(MipsISD::Ext, DL, ValTy,
|
||||
ShiftRight.getOperand(0),
|
||||
DAG.getConstant(Pos, DL, MVT::i32),
|
||||
DAG.getConstant(SMSize, DL, MVT::i32));
|
||||
return DAG.getNode(MipsISD::Ext, SDLoc(N), ValTy,
|
||||
ShiftRight.getOperand(0), DAG.getConstant(Pos, MVT::i32),
|
||||
DAG.getConstant(SMSize, MVT::i32));
|
||||
}
|
||||
|
||||
static SDValue performORCombine(SDNode *N, SelectionDAG &DAG,
|
||||
@@ -755,11 +753,9 @@ static SDValue performORCombine(SDNode *N, SelectionDAG &DAG,
|
||||
if ((Shamt != SMPos0) || (SMPos0 + SMSize0 > ValTy.getSizeInBits()))
|
||||
return SDValue();
|
||||
|
||||
SDLoc DL(N);
|
||||
return DAG.getNode(MipsISD::Ins, DL, ValTy, Shl.getOperand(0),
|
||||
DAG.getConstant(SMPos0, DL, MVT::i32),
|
||||
DAG.getConstant(SMSize0, DL, MVT::i32),
|
||||
And0.getOperand(0));
|
||||
return DAG.getNode(MipsISD::Ins, SDLoc(N), ValTy, Shl.getOperand(0),
|
||||
DAG.getConstant(SMPos0, MVT::i32),
|
||||
DAG.getConstant(SMSize0, MVT::i32), And0.getOperand(0));
|
||||
}
|
||||
|
||||
static SDValue performADDCombine(SDNode *N, SelectionDAG &DAG,
|
||||
@@ -1560,7 +1556,7 @@ SDValue MipsTargetLowering::lowerBR_JT(SDValue Op, SelectionDAG &DAG) const {
|
||||
DAG.getMachineFunction().getJumpTableInfo()->getEntrySize(*getDataLayout());
|
||||
|
||||
Index = DAG.getNode(ISD::MUL, DL, PTy, Index,
|
||||
DAG.getConstant(EntrySize, DL, PTy));
|
||||
DAG.getConstant(EntrySize, PTy));
|
||||
SDValue Addr = DAG.getNode(ISD::ADD, DL, PTy, Index, Table);
|
||||
|
||||
EVT MemVT = EVT::getIntegerVT(*DAG.getContext(), EntrySize * 8);
|
||||
@@ -1598,7 +1594,7 @@ SDValue MipsTargetLowering::lowerBRCOND(SDValue Op, SelectionDAG &DAG) const {
|
||||
Mips::CondCode CC =
|
||||
(Mips::CondCode)cast<ConstantSDNode>(CCNode)->getZExtValue();
|
||||
unsigned Opc = invertFPCondCodeUser(CC) ? Mips::BRANCH_F : Mips::BRANCH_T;
|
||||
SDValue BrCode = DAG.getConstant(Opc, DL, MVT::i32);
|
||||
SDValue BrCode = DAG.getConstant(Opc, MVT::i32);
|
||||
SDValue FCC0 = DAG.getRegister(Mips::FCC0, MVT::i32);
|
||||
return DAG.getNode(MipsISD::FPBrcond, DL, Op.getValueType(), Chain, BrCode,
|
||||
FCC0, Dest, CondRes);
|
||||
@@ -1639,11 +1635,10 @@ SDValue MipsTargetLowering::lowerSETCC(SDValue Op, SelectionDAG &DAG) const {
|
||||
assert(Cond.getOpcode() == MipsISD::FPCmp &&
|
||||
"Floating point operand expected.");
|
||||
|
||||
SDLoc DL(Op);
|
||||
SDValue True = DAG.getConstant(1, DL, MVT::i32);
|
||||
SDValue False = DAG.getConstant(0, DL, MVT::i32);
|
||||
SDValue True = DAG.getConstant(1, MVT::i32);
|
||||
SDValue False = DAG.getConstant(0, MVT::i32);
|
||||
|
||||
return createCMovFP(DAG, Cond, True, False, DL);
|
||||
return createCMovFP(DAG, Cond, True, False, SDLoc(Op));
|
||||
}
|
||||
|
||||
SDValue MipsTargetLowering::lowerGlobalAddress(SDValue Op,
|
||||
@@ -1842,19 +1837,19 @@ SDValue MipsTargetLowering::lowerVAARG(SDValue Op, SelectionDAG &DAG) const {
|
||||
assert(((Align & (Align-1)) == 0) && "Expected Align to be a power of 2");
|
||||
|
||||
VAList = DAG.getNode(ISD::ADD, DL, VAList.getValueType(), VAList,
|
||||
DAG.getConstant(Align - 1, DL, VAList.getValueType()));
|
||||
DAG.getConstant(Align - 1,
|
||||
VAList.getValueType()));
|
||||
|
||||
VAList = DAG.getNode(ISD::AND, DL, VAList.getValueType(), VAList,
|
||||
DAG.getConstant(-(int64_t)Align, DL,
|
||||
DAG.getConstant(-(int64_t)Align,
|
||||
VAList.getValueType()));
|
||||
}
|
||||
|
||||
// Increment the pointer, VAList, to the next vaarg.
|
||||
unsigned ArgSizeInBytes = getDataLayout()->getTypeAllocSize(VT.getTypeForEVT(*DAG.getContext()));
|
||||
SDValue Tmp3 = DAG.getNode(ISD::ADD, DL, VAList.getValueType(), VAList,
|
||||
DAG.getConstant(RoundUpToAlignment(ArgSizeInBytes,
|
||||
ArgSlotSizeInBytes),
|
||||
DL, VAList.getValueType()));
|
||||
DAG.getConstant(RoundUpToAlignment(ArgSizeInBytes, ArgSlotSizeInBytes),
|
||||
VAList.getValueType()));
|
||||
// Store the incremented VAList to the legalized pointer
|
||||
Chain = DAG.getStore(VAListLoad.getValue(1), DL, Tmp3, VAListPtr,
|
||||
MachinePointerInfo(SV), false, false, 0);
|
||||
@@ -1867,7 +1862,7 @@ SDValue MipsTargetLowering::lowerVAARG(SDValue Op, SelectionDAG &DAG) const {
|
||||
if (!Subtarget.isLittle() && ArgSizeInBytes < ArgSlotSizeInBytes) {
|
||||
unsigned Adjustment = ArgSlotSizeInBytes - ArgSizeInBytes;
|
||||
VAList = DAG.getNode(ISD::ADD, DL, VAListPtr.getValueType(), VAList,
|
||||
DAG.getIntPtrConstant(Adjustment, DL));
|
||||
DAG.getIntPtrConstant(Adjustment));
|
||||
}
|
||||
// Load the actual argument out of the pointer VAList
|
||||
return DAG.getLoad(VT, DL, Chain, VAList, MachinePointerInfo(), false, false,
|
||||
@@ -1878,9 +1873,9 @@ static SDValue lowerFCOPYSIGN32(SDValue Op, SelectionDAG &DAG,
|
||||
bool HasExtractInsert) {
|
||||
EVT TyX = Op.getOperand(0).getValueType();
|
||||
EVT TyY = Op.getOperand(1).getValueType();
|
||||
SDValue Const1 = DAG.getConstant(1, MVT::i32);
|
||||
SDValue Const31 = DAG.getConstant(31, MVT::i32);
|
||||
SDLoc DL(Op);
|
||||
SDValue Const1 = DAG.getConstant(1, DL, MVT::i32);
|
||||
SDValue Const31 = DAG.getConstant(31, DL, MVT::i32);
|
||||
SDValue Res;
|
||||
|
||||
// If operand is of type f64, extract the upper 32-bit. Otherwise, bitcast it
|
||||
@@ -1916,8 +1911,7 @@ static SDValue lowerFCOPYSIGN32(SDValue Op, SelectionDAG &DAG,
|
||||
return DAG.getNode(ISD::BITCAST, DL, Op.getOperand(0).getValueType(), Res);
|
||||
|
||||
SDValue LowX = DAG.getNode(MipsISD::ExtractElementF64, DL, MVT::i32,
|
||||
Op.getOperand(0),
|
||||
DAG.getConstant(0, DL, MVT::i32));
|
||||
Op.getOperand(0), DAG.getConstant(0, MVT::i32));
|
||||
return DAG.getNode(MipsISD::BuildPairF64, DL, MVT::f64, LowX, Res);
|
||||
}
|
||||
|
||||
@@ -1926,8 +1920,8 @@ static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG,
|
||||
unsigned WidthX = Op.getOperand(0).getValueSizeInBits();
|
||||
unsigned WidthY = Op.getOperand(1).getValueSizeInBits();
|
||||
EVT TyX = MVT::getIntegerVT(WidthX), TyY = MVT::getIntegerVT(WidthY);
|
||||
SDValue Const1 = DAG.getConstant(1, MVT::i32);
|
||||
SDLoc DL(Op);
|
||||
SDValue Const1 = DAG.getConstant(1, DL, MVT::i32);
|
||||
|
||||
// Bitcast to integer nodes.
|
||||
SDValue X = DAG.getNode(ISD::BITCAST, DL, TyX, Op.getOperand(0));
|
||||
@@ -1937,7 +1931,7 @@ static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG,
|
||||
// ext E, Y, width(Y) - 1, 1 ; extract bit width(Y)-1 of Y
|
||||
// ins X, E, width(X) - 1, 1 ; insert extracted bit at bit width(X)-1 of X
|
||||
SDValue E = DAG.getNode(MipsISD::Ext, DL, TyY, Y,
|
||||
DAG.getConstant(WidthY - 1, DL, MVT::i32), Const1);
|
||||
DAG.getConstant(WidthY - 1, MVT::i32), Const1);
|
||||
|
||||
if (WidthX > WidthY)
|
||||
E = DAG.getNode(ISD::ZERO_EXTEND, DL, TyX, E);
|
||||
@@ -1945,8 +1939,7 @@ static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG,
|
||||
E = DAG.getNode(ISD::TRUNCATE, DL, TyX, E);
|
||||
|
||||
SDValue I = DAG.getNode(MipsISD::Ins, DL, TyX, E,
|
||||
DAG.getConstant(WidthX - 1, DL, MVT::i32), Const1,
|
||||
X);
|
||||
DAG.getConstant(WidthX - 1, MVT::i32), Const1, X);
|
||||
return DAG.getNode(ISD::BITCAST, DL, Op.getOperand(0).getValueType(), I);
|
||||
}
|
||||
|
||||
@@ -1958,7 +1951,7 @@ static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG,
|
||||
SDValue SllX = DAG.getNode(ISD::SHL, DL, TyX, X, Const1);
|
||||
SDValue SrlX = DAG.getNode(ISD::SRL, DL, TyX, SllX, Const1);
|
||||
SDValue SrlY = DAG.getNode(ISD::SRL, DL, TyY, Y,
|
||||
DAG.getConstant(WidthY - 1, DL, MVT::i32));
|
||||
DAG.getConstant(WidthY - 1, MVT::i32));
|
||||
|
||||
if (WidthX > WidthY)
|
||||
SrlY = DAG.getNode(ISD::ZERO_EXTEND, DL, TyX, SrlY);
|
||||
@@ -1966,7 +1959,7 @@ static SDValue lowerFCOPYSIGN64(SDValue Op, SelectionDAG &DAG,
|
||||
SrlY = DAG.getNode(ISD::TRUNCATE, DL, TyX, SrlY);
|
||||
|
||||
SDValue SllY = DAG.getNode(ISD::SHL, DL, TyX, SrlY,
|
||||
DAG.getConstant(WidthX - 1, DL, MVT::i32));
|
||||
DAG.getConstant(WidthX - 1, MVT::i32));
|
||||
SDValue Or = DAG.getNode(ISD::OR, DL, TyX, SrlX, SllY);
|
||||
return DAG.getNode(ISD::BITCAST, DL, Op.getOperand(0).getValueType(), Or);
|
||||
}
|
||||
@@ -2049,7 +2042,7 @@ SDValue MipsTargetLowering::lowerATOMIC_FENCE(SDValue Op,
|
||||
unsigned SType = 0;
|
||||
SDLoc DL(Op);
|
||||
return DAG.getNode(MipsISD::Sync, DL, MVT::Other, Op.getOperand(0),
|
||||
DAG.getConstant(SType, DL, MVT::i32));
|
||||
DAG.getConstant(SType, MVT::i32));
|
||||
}
|
||||
|
||||
SDValue MipsTargetLowering::lowerShiftLeftParts(SDValue Op,
|
||||
@@ -2066,17 +2059,17 @@ SDValue MipsTargetLowering::lowerShiftLeftParts(SDValue Op,
|
||||
// lo = 0
|
||||
// hi = (shl lo, shamt[4:0])
|
||||
SDValue Not = DAG.getNode(ISD::XOR, DL, MVT::i32, Shamt,
|
||||
DAG.getConstant(-1, DL, MVT::i32));
|
||||
DAG.getConstant(-1, MVT::i32));
|
||||
SDValue ShiftRight1Lo = DAG.getNode(ISD::SRL, DL, VT, Lo,
|
||||
DAG.getConstant(1, DL, VT));
|
||||
DAG.getConstant(1, VT));
|
||||
SDValue ShiftRightLo = DAG.getNode(ISD::SRL, DL, VT, ShiftRight1Lo, Not);
|
||||
SDValue ShiftLeftHi = DAG.getNode(ISD::SHL, DL, VT, Hi, Shamt);
|
||||
SDValue Or = DAG.getNode(ISD::OR, DL, VT, ShiftLeftHi, ShiftRightLo);
|
||||
SDValue ShiftLeftLo = DAG.getNode(ISD::SHL, DL, VT, Lo, Shamt);
|
||||
SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
|
||||
DAG.getConstant(0x20, DL, MVT::i32));
|
||||
DAG.getConstant(0x20, MVT::i32));
|
||||
Lo = DAG.getNode(ISD::SELECT, DL, VT, Cond,
|
||||
DAG.getConstant(0, DL, VT), ShiftLeftLo);
|
||||
DAG.getConstant(0, VT), ShiftLeftLo);
|
||||
Hi = DAG.getNode(ISD::SELECT, DL, VT, Cond, ShiftLeftLo, Or);
|
||||
|
||||
SDValue Ops[2] = {Lo, Hi};
|
||||
@@ -2104,21 +2097,20 @@ SDValue MipsTargetLowering::lowerShiftRightParts(SDValue Op, SelectionDAG &DAG,
|
||||
// lo = (srl hi, shamt[4:0])
|
||||
// hi = 0
|
||||
SDValue Not = DAG.getNode(ISD::XOR, DL, MVT::i32, Shamt,
|
||||
DAG.getConstant(-1, DL, MVT::i32));
|
||||
DAG.getConstant(-1, MVT::i32));
|
||||
SDValue ShiftLeft1Hi = DAG.getNode(ISD::SHL, DL, VT, Hi,
|
||||
DAG.getConstant(1, DL, VT));
|
||||
DAG.getConstant(1, VT));
|
||||
SDValue ShiftLeftHi = DAG.getNode(ISD::SHL, DL, VT, ShiftLeft1Hi, Not);
|
||||
SDValue ShiftRightLo = DAG.getNode(ISD::SRL, DL, VT, Lo, Shamt);
|
||||
SDValue Or = DAG.getNode(ISD::OR, DL, VT, ShiftLeftHi, ShiftRightLo);
|
||||
SDValue ShiftRightHi = DAG.getNode(IsSRA ? ISD::SRA : ISD::SRL,
|
||||
DL, VT, Hi, Shamt);
|
||||
SDValue Cond = DAG.getNode(ISD::AND, DL, MVT::i32, Shamt,
|
||||
DAG.getConstant(0x20, DL, MVT::i32));
|
||||
SDValue Shift31 = DAG.getNode(ISD::SRA, DL, VT, Hi,
|
||||
DAG.getConstant(31, DL, VT));
|
||||
DAG.getConstant(0x20, MVT::i32));
|
||||
SDValue Shift31 = DAG.getNode(ISD::SRA, DL, VT, Hi, DAG.getConstant(31, VT));
|
||||
Lo = DAG.getNode(ISD::SELECT, DL, VT, Cond, ShiftRightHi, Or);
|
||||
Hi = DAG.getNode(ISD::SELECT, DL, VT, Cond,
|
||||
IsSRA ? Shift31 : DAG.getConstant(0, DL, VT), ShiftRightHi);
|
||||
IsSRA ? Shift31 : DAG.getConstant(0, VT), ShiftRightHi);
|
||||
|
||||
SDValue Ops[2] = {Lo, Hi};
|
||||
return DAG.getMergeValues(Ops, DL);
|
||||
@@ -2134,7 +2126,7 @@ static SDValue createLoadLR(unsigned Opc, SelectionDAG &DAG, LoadSDNode *LD,
|
||||
|
||||
if (Offset)
|
||||
Ptr = DAG.getNode(ISD::ADD, DL, BasePtrVT, Ptr,
|
||||
DAG.getConstant(Offset, DL, BasePtrVT));
|
||||
DAG.getConstant(Offset, BasePtrVT));
|
||||
|
||||
SDValue Ops[] = { Chain, Ptr, Src };
|
||||
return DAG.getMemIntrinsicNode(Opc, DL, VTList, Ops, MemVT,
|
||||
@@ -2199,7 +2191,7 @@ SDValue MipsTargetLowering::lowerLOAD(SDValue Op, SelectionDAG &DAG) const {
|
||||
// (set tmp2, (shl tmp1, 32))
|
||||
// (set dst, (srl tmp2, 32))
|
||||
SDLoc DL(LD);
|
||||
SDValue Const32 = DAG.getConstant(32, DL, MVT::i32);
|
||||
SDValue Const32 = DAG.getConstant(32, MVT::i32);
|
||||
SDValue SLL = DAG.getNode(ISD::SHL, DL, MVT::i64, LWR, Const32);
|
||||
SDValue SRL = DAG.getNode(ISD::SRL, DL, MVT::i64, SLL, Const32);
|
||||
SDValue Ops[] = { SRL, LWR.getValue(1) };
|
||||
@@ -2215,7 +2207,7 @@ static SDValue createStoreLR(unsigned Opc, SelectionDAG &DAG, StoreSDNode *SD,
|
||||
|
||||
if (Offset)
|
||||
Ptr = DAG.getNode(ISD::ADD, DL, BasePtrVT, Ptr,
|
||||
DAG.getConstant(Offset, DL, BasePtrVT));
|
||||
DAG.getConstant(Offset, BasePtrVT));
|
||||
|
||||
SDValue Ops[] = { Chain, Value, Ptr };
|
||||
return DAG.getMemIntrinsicNode(Opc, DL, VTList, Ops, MemVT,
|
||||
@@ -2297,9 +2289,8 @@ SDValue MipsTargetLowering::lowerADD(SDValue Op, SelectionDAG &DAG) const {
|
||||
EVT ValTy = Op->getValueType(0);
|
||||
int FI = MFI->CreateFixedObject(Op.getValueSizeInBits() / 8, 0, false);
|
||||
SDValue InArgsAddr = DAG.getFrameIndex(FI, ValTy);
|
||||
SDLoc DL(Op);
|
||||
return DAG.getNode(ISD::ADD, DL, ValTy, InArgsAddr,
|
||||
DAG.getConstant(0, DL, ValTy));
|
||||
return DAG.getNode(ISD::ADD, SDLoc(Op), ValTy, InArgsAddr,
|
||||
DAG.getConstant(0, ValTy));
|
||||
}
|
||||
|
||||
SDValue MipsTargetLowering::lowerFP_TO_SINT(SDValue Op,
|
||||
@@ -2456,7 +2447,7 @@ MipsTargetLowering::passArgOnStack(SDValue StackPtr, unsigned Offset,
|
||||
bool IsTailCall, SelectionDAG &DAG) const {
|
||||
if (!IsTailCall) {
|
||||
SDValue PtrOff = DAG.getNode(ISD::ADD, DL, getPointerTy(), StackPtr,
|
||||
DAG.getIntPtrConstant(Offset, DL));
|
||||
DAG.getIntPtrConstant(Offset));
|
||||
return DAG.getStore(Chain, DL, Arg, PtrOff, MachinePointerInfo(), false,
|
||||
false, 0);
|
||||
}
|
||||
@@ -2582,7 +2573,7 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
||||
// byval arguments to the stack.
|
||||
unsigned StackAlignment = TFL->getStackAlignment();
|
||||
NextStackOffset = RoundUpToAlignment(NextStackOffset, StackAlignment);
|
||||
SDValue NextStackOffsetVal = DAG.getIntPtrConstant(NextStackOffset, DL, true);
|
||||
SDValue NextStackOffsetVal = DAG.getIntPtrConstant(NextStackOffset, true);
|
||||
|
||||
if (!IsTailCall)
|
||||
Chain = DAG.getCALLSEQ_START(Chain, NextStackOffsetVal, DL);
|
||||
@@ -2634,9 +2625,9 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
||||
Arg = DAG.getNode(ISD::BITCAST, DL, LocVT, Arg);
|
||||
else if (ValVT == MVT::f64 && LocVT == MVT::i32) {
|
||||
SDValue Lo = DAG.getNode(MipsISD::ExtractElementF64, DL, MVT::i32,
|
||||
Arg, DAG.getConstant(0, DL, MVT::i32));
|
||||
Arg, DAG.getConstant(0, MVT::i32));
|
||||
SDValue Hi = DAG.getNode(MipsISD::ExtractElementF64, DL, MVT::i32,
|
||||
Arg, DAG.getConstant(1, DL, MVT::i32));
|
||||
Arg, DAG.getConstant(1, MVT::i32));
|
||||
if (!Subtarget.isLittle())
|
||||
std::swap(Lo, Hi);
|
||||
unsigned LocRegLo = VA.getLocReg();
|
||||
@@ -2675,7 +2666,7 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
||||
unsigned LocSizeInBits = VA.getLocVT().getSizeInBits();
|
||||
Arg = DAG.getNode(
|
||||
ISD::SHL, DL, VA.getLocVT(), Arg,
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, DL, VA.getLocVT()));
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, VA.getLocVT()));
|
||||
}
|
||||
|
||||
// Arguments that can be passed on register must be kept at
|
||||
@@ -2764,7 +2755,7 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
||||
|
||||
// Create the CALLSEQ_END node.
|
||||
Chain = DAG.getCALLSEQ_END(Chain, NextStackOffsetVal,
|
||||
DAG.getIntPtrConstant(0, DL, true), InFlag, DL);
|
||||
DAG.getIntPtrConstant(0, true), InFlag, DL);
|
||||
InFlag = Chain.getValue(1);
|
||||
|
||||
// Handle result values, copying them out of physregs into vregs that we
|
||||
@@ -2803,7 +2794,7 @@ SDValue MipsTargetLowering::LowerCallResult(
|
||||
VA.getLocInfo() == CCValAssign::ZExtUpper ? ISD::SRL : ISD::SRA;
|
||||
Val = DAG.getNode(
|
||||
Shift, DL, VA.getLocVT(), Val,
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, DL, VA.getLocVT()));
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, VA.getLocVT()));
|
||||
}
|
||||
|
||||
switch (VA.getLocInfo()) {
|
||||
@@ -2856,7 +2847,7 @@ static SDValue UnpackFromArgumentSlot(SDValue Val, const CCValAssign &VA,
|
||||
VA.getLocInfo() == CCValAssign::ZExtUpper ? ISD::SRL : ISD::SRA;
|
||||
Val = DAG.getNode(
|
||||
Opcode, DL, VA.getLocVT(), Val,
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, DL, VA.getLocVT()));
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, VA.getLocVT()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3130,7 +3121,7 @@ MipsTargetLowering::LowerReturn(SDValue Chain,
|
||||
unsigned LocSizeInBits = VA.getLocVT().getSizeInBits();
|
||||
Val = DAG.getNode(
|
||||
ISD::SHL, DL, VA.getLocVT(), Val,
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, DL, VA.getLocVT()));
|
||||
DAG.getConstant(LocSizeInBits - ValSizeInBits, VA.getLocVT()));
|
||||
}
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, DL, VA.getLocReg(), Val, Flag);
|
||||
@@ -3432,7 +3423,6 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
std::string &Constraint,
|
||||
std::vector<SDValue>&Ops,
|
||||
SelectionDAG &DAG) const {
|
||||
SDLoc DL(Op);
|
||||
SDValue Result;
|
||||
|
||||
// Only support length 1 constraints for now.
|
||||
@@ -3447,7 +3437,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
int64_t Val = C->getSExtValue();
|
||||
if (isInt<16>(Val)) {
|
||||
Result = DAG.getTargetConstant(Val, DL, Type);
|
||||
Result = DAG.getTargetConstant(Val, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3457,7 +3447,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
int64_t Val = C->getZExtValue();
|
||||
if (Val == 0) {
|
||||
Result = DAG.getTargetConstant(0, DL, Type);
|
||||
Result = DAG.getTargetConstant(0, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3467,7 +3457,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
uint64_t Val = (uint64_t)C->getZExtValue();
|
||||
if (isUInt<16>(Val)) {
|
||||
Result = DAG.getTargetConstant(Val, DL, Type);
|
||||
Result = DAG.getTargetConstant(Val, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3477,7 +3467,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
int64_t Val = C->getSExtValue();
|
||||
if ((isInt<32>(Val)) && ((Val & 0xffff) == 0)){
|
||||
Result = DAG.getTargetConstant(Val, DL, Type);
|
||||
Result = DAG.getTargetConstant(Val, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3487,7 +3477,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
int64_t Val = C->getSExtValue();
|
||||
if ((Val >= -65535) && (Val <= -1)) {
|
||||
Result = DAG.getTargetConstant(Val, DL, Type);
|
||||
Result = DAG.getTargetConstant(Val, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3497,7 +3487,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
int64_t Val = C->getSExtValue();
|
||||
if ((isInt<15>(Val))) {
|
||||
Result = DAG.getTargetConstant(Val, DL, Type);
|
||||
Result = DAG.getTargetConstant(Val, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3507,7 +3497,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
||||
EVT Type = Op.getValueType();
|
||||
int64_t Val = C->getSExtValue();
|
||||
if ((Val <= 65535) && (Val >= 1)) {
|
||||
Result = DAG.getTargetConstant(Val, DL, Type);
|
||||
Result = DAG.getTargetConstant(Val, Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3613,7 +3603,7 @@ void MipsTargetLowering::copyByValRegs(
|
||||
unsigned VReg = addLiveIn(MF, ArgReg, RC);
|
||||
unsigned Offset = I * GPRSizeInBytes;
|
||||
SDValue StorePtr = DAG.getNode(ISD::ADD, DL, PtrTy, FIN,
|
||||
DAG.getConstant(Offset, DL, PtrTy));
|
||||
DAG.getConstant(Offset, PtrTy));
|
||||
SDValue Store = DAG.getStore(Chain, DL, DAG.getRegister(VReg, RegTy),
|
||||
StorePtr, MachinePointerInfo(FuncArg, Offset),
|
||||
false, false, 0);
|
||||
@@ -3644,7 +3634,7 @@ void MipsTargetLowering::passByValArg(
|
||||
// Copy words to registers.
|
||||
for (; I < NumRegs - LeftoverBytes; ++I, OffsetInBytes += RegSizeInBytes) {
|
||||
SDValue LoadPtr = DAG.getNode(ISD::ADD, DL, PtrTy, Arg,
|
||||
DAG.getConstant(OffsetInBytes, DL, PtrTy));
|
||||
DAG.getConstant(OffsetInBytes, PtrTy));
|
||||
SDValue LoadVal = DAG.getLoad(RegTy, DL, Chain, LoadPtr,
|
||||
MachinePointerInfo(), false, false, false,
|
||||
Alignment);
|
||||
@@ -3670,8 +3660,7 @@ void MipsTargetLowering::passByValArg(
|
||||
|
||||
// Load subword.
|
||||
SDValue LoadPtr = DAG.getNode(ISD::ADD, DL, PtrTy, Arg,
|
||||
DAG.getConstant(OffsetInBytes, DL,
|
||||
PtrTy));
|
||||
DAG.getConstant(OffsetInBytes, PtrTy));
|
||||
SDValue LoadVal = DAG.getExtLoad(
|
||||
ISD::ZEXTLOAD, DL, RegTy, Chain, LoadPtr, MachinePointerInfo(),
|
||||
MVT::getIntegerVT(LoadSizeInBytes * 8), false, false, false,
|
||||
@@ -3687,7 +3676,7 @@ void MipsTargetLowering::passByValArg(
|
||||
Shamt = (RegSizeInBytes - (TotalBytesLoaded + LoadSizeInBytes)) * 8;
|
||||
|
||||
SDValue Shift = DAG.getNode(ISD::SHL, DL, RegTy, LoadVal,
|
||||
DAG.getConstant(Shamt, DL, MVT::i32));
|
||||
DAG.getConstant(Shamt, MVT::i32));
|
||||
|
||||
if (Val.getNode())
|
||||
Val = DAG.getNode(ISD::OR, DL, RegTy, Val, Shift);
|
||||
@@ -3708,11 +3697,10 @@ void MipsTargetLowering::passByValArg(
|
||||
// Copy remainder of byval arg to it with memcpy.
|
||||
unsigned MemCpySize = ByValSizeInBytes - OffsetInBytes;
|
||||
SDValue Src = DAG.getNode(ISD::ADD, DL, PtrTy, Arg,
|
||||
DAG.getConstant(OffsetInBytes, DL, PtrTy));
|
||||
DAG.getConstant(OffsetInBytes, PtrTy));
|
||||
SDValue Dst = DAG.getNode(ISD::ADD, DL, PtrTy, StackPtr,
|
||||
DAG.getIntPtrConstant(VA.getLocMemOffset(), DL));
|
||||
Chain = DAG.getMemcpy(Chain, DL, Dst, Src,
|
||||
DAG.getConstant(MemCpySize, DL, PtrTy),
|
||||
DAG.getIntPtrConstant(VA.getLocMemOffset()));
|
||||
Chain = DAG.getMemcpy(Chain, DL, Dst, Src, DAG.getConstant(MemCpySize, PtrTy),
|
||||
Alignment, /*isVolatile=*/false, /*AlwaysInline=*/false,
|
||||
/*isTailCall=*/false,
|
||||
MachinePointerInfo(), MachinePointerInfo());
|
||||
|
||||
Reference in New Issue
Block a user