forked from OSchip/llvm-project
Split the SDValue out of OutputArg so that SelectionDAG-independent
code can do calling-convention queries. This obviates OutputArgReg. llvm-svn: 107786
This commit is contained in:
parent
ca97c92eb4
commit
fe7532a308
|
@ -184,8 +184,6 @@ public:
|
|||
/// incorporating info about the result values into this state.
|
||||
void AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
CCAssignFn Fn);
|
||||
void AnalyzeReturn(const SmallVectorImpl<ISD::OutputArgReg> &Outs,
|
||||
CCAssignFn Fn);
|
||||
|
||||
/// CheckReturn - Analyze the return values of a function, returning
|
||||
/// true if the return can be performed without sret-demotion, and
|
||||
|
@ -198,8 +196,6 @@ public:
|
|||
/// incorporating info about the passed values into this state.
|
||||
void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
CCAssignFn Fn);
|
||||
void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArgReg> &Outs,
|
||||
CCAssignFn Fn);
|
||||
|
||||
/// AnalyzeCallOperands - Same as above except it takes vectors of types
|
||||
/// and argument flags.
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#ifndef LLVM_TARGET_TARGETCALLINGCONV_H
|
||||
#define LLVM_TARGET_TARGETCALLINGCONV_H
|
||||
|
||||
#include "llvm/CodeGen/SelectionDAGNodes.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
namespace ISD {
|
||||
|
@ -112,7 +110,7 @@ namespace ISD {
|
|||
bool Used;
|
||||
|
||||
InputArg() : VT(MVT::Other), Used(false) {}
|
||||
InputArg(ISD::ArgFlagsTy flags, EVT vt, bool used)
|
||||
InputArg(ArgFlagsTy flags, EVT vt, bool used)
|
||||
: Flags(flags), VT(vt), Used(used) {
|
||||
assert(VT.isSimple() &&
|
||||
"InputArg value type must be Simple!");
|
||||
|
@ -125,35 +123,18 @@ namespace ISD {
|
|||
///
|
||||
struct OutputArg {
|
||||
ArgFlagsTy Flags;
|
||||
SDValue Val;
|
||||
EVT VT;
|
||||
|
||||
/// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...".
|
||||
bool IsFixed;
|
||||
|
||||
OutputArg() : IsFixed(false) {}
|
||||
OutputArg(ISD::ArgFlagsTy flags, SDValue val, bool isfixed)
|
||||
: Flags(flags), Val(val), IsFixed(isfixed) {
|
||||
assert(Val.getValueType().isSimple() &&
|
||||
OutputArg(ArgFlagsTy flags, EVT vt, bool isfixed)
|
||||
: Flags(flags), VT(vt), IsFixed(isfixed) {
|
||||
assert(VT.isSimple() &&
|
||||
"OutputArg value type must be Simple!");
|
||||
}
|
||||
};
|
||||
|
||||
/// OutputArgReg - This struct carries flags and a register value for a
|
||||
/// single outgoing (actual) argument or outgoing (from the perspective
|
||||
/// of the caller) return value virtual register.
|
||||
///
|
||||
struct OutputArgReg {
|
||||
ArgFlagsTy Flags;
|
||||
EVT VT;
|
||||
unsigned Reg;
|
||||
|
||||
/// IsFixed - Is this a "fixed" value, ie not passed through a vararg "...".
|
||||
bool IsFixed;
|
||||
|
||||
OutputArgReg() : IsFixed(false) {}
|
||||
OutputArgReg(ISD::ArgFlagsTy flags, EVT vt, unsigned reg, bool isfixed)
|
||||
: Flags(flags), VT(vt), Reg(reg), IsFixed(isfixed) {}
|
||||
};
|
||||
}
|
||||
|
||||
} // end llvm namespace
|
||||
|
|
|
@ -1145,6 +1145,7 @@ public:
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -1173,6 +1174,7 @@ public:
|
|||
virtual SDValue
|
||||
LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
assert(0 && "Not Implemented");
|
||||
return SDValue(); // this is here to silence compiler errors
|
||||
|
|
|
@ -98,22 +98,6 @@ bool CCState::CheckReturn(const SmallVectorImpl<EVT> &OutTys,
|
|||
void CCState::AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
CCAssignFn Fn) {
|
||||
// Determine which register each value should be copied into.
|
||||
for (unsigned i = 0, e = Outs.size(); i != e; ++i) {
|
||||
EVT VT = Outs[i].Val.getValueType();
|
||||
ISD::ArgFlagsTy ArgFlags = Outs[i].Flags;
|
||||
if (Fn(i, VT, VT, CCValAssign::Full, ArgFlags, *this)) {
|
||||
#ifndef NDEBUG
|
||||
dbgs() << "Return operand #" << i << " has unhandled type "
|
||||
<< VT.getEVTString();
|
||||
#endif
|
||||
llvm_unreachable(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CCState::AnalyzeReturn(const SmallVectorImpl<ISD::OutputArgReg> &Outs,
|
||||
CCAssignFn Fn) {
|
||||
// Determine which register each value should be copied into.
|
||||
for (unsigned i = 0, e = Outs.size(); i != e; ++i) {
|
||||
EVT VT = Outs[i].VT;
|
||||
ISD::ArgFlagsTy ArgFlags = Outs[i].Flags;
|
||||
|
@ -127,31 +111,11 @@ void CCState::AnalyzeReturn(const SmallVectorImpl<ISD::OutputArgReg> &Outs,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// AnalyzeCallOperands - Analyze the outgoing arguments to a call,
|
||||
/// incorporating info about the passed values into this state.
|
||||
void CCState::AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
CCAssignFn Fn) {
|
||||
unsigned NumOps = Outs.size();
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
EVT ArgVT = Outs[i].Val.getValueType();
|
||||
ISD::ArgFlagsTy ArgFlags = Outs[i].Flags;
|
||||
if (Fn(i, ArgVT, ArgVT, CCValAssign::Full, ArgFlags, *this)) {
|
||||
#ifndef NDEBUG
|
||||
dbgs() << "Call operand #" << i << " has unhandled type "
|
||||
<< ArgVT.getEVTString();
|
||||
#endif
|
||||
llvm_unreachable(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// AnalyzeCallOperands - Analyze the outgoing arguments to a call,
|
||||
/// incorporating info about the passed values into this state.
|
||||
void
|
||||
CCState::AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArgReg> &Outs,
|
||||
CCAssignFn Fn) {
|
||||
unsigned NumOps = Outs.size();
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
EVT ArgVT = Outs[i].VT;
|
||||
ISD::ArgFlagsTy ArgFlags = Outs[i].Flags;
|
||||
|
|
|
@ -1027,6 +1027,7 @@ static void getReturnInfo(const Type* ReturnType,
|
|||
void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
||||
SDValue Chain = getControlRoot();
|
||||
SmallVector<ISD::OutputArg, 8> Outs;
|
||||
SmallVector<SDValue, 8> OutVals;
|
||||
|
||||
if (!FuncInfo.CanLowerReturn) {
|
||||
unsigned DemoteReg = FuncInfo.DemoteRegister;
|
||||
|
@ -1105,8 +1106,11 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||
else if (F->paramHasAttr(0, Attribute::ZExt))
|
||||
Flags.setZExt();
|
||||
|
||||
for (unsigned i = 0; i < NumParts; ++i)
|
||||
Outs.push_back(ISD::OutputArg(Flags, Parts[i], /*isfixed=*/true));
|
||||
for (unsigned i = 0; i < NumParts; ++i) {
|
||||
Outs.push_back(ISD::OutputArg(Flags, Parts[i].getValueType(),
|
||||
/*isfixed=*/true));
|
||||
OutVals.push_back(Parts[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1115,7 +1119,7 @@ void SelectionDAGBuilder::visitRet(const ReturnInst &I) {
|
|||
CallingConv::ID CallConv =
|
||||
DAG.getMachineFunction().getFunction()->getCallingConv();
|
||||
Chain = TLI.LowerReturn(Chain, CallConv, isVarArg,
|
||||
Outs, getCurDebugLoc(), DAG);
|
||||
Outs, OutVals, getCurDebugLoc(), DAG);
|
||||
|
||||
// Verify that the target's LowerReturn behaved as expected.
|
||||
assert(Chain.getNode() && Chain.getValueType() == MVT::Other &&
|
||||
|
@ -5768,6 +5772,7 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
DebugLoc dl) const {
|
||||
// Handle all of the outgoing arguments.
|
||||
SmallVector<ISD::OutputArg, 32> Outs;
|
||||
SmallVector<SDValue, 32> OutVals;
|
||||
for (unsigned i = 0, e = Args.size(); i != e; ++i) {
|
||||
SmallVector<EVT, 4> ValueVTs;
|
||||
ComputeValueVTs(*this, Args[i].Ty, ValueVTs);
|
||||
|
@ -5821,13 +5826,15 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
|
||||
for (unsigned j = 0; j != NumParts; ++j) {
|
||||
// if it isn't first piece, alignment must be 1
|
||||
ISD::OutputArg MyFlags(Flags, Parts[j], i < NumFixedArgs);
|
||||
ISD::OutputArg MyFlags(Flags, Parts[j].getValueType(),
|
||||
i < NumFixedArgs);
|
||||
if (NumParts > 1 && j == 0)
|
||||
MyFlags.Flags.setSplit();
|
||||
else if (j != 0)
|
||||
MyFlags.Flags.setOrigAlign(1);
|
||||
|
||||
Outs.push_back(MyFlags);
|
||||
OutVals.push_back(Parts[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5856,7 +5863,7 @@ TargetLowering::LowerCallTo(SDValue Chain, const Type *RetTy,
|
|||
|
||||
SmallVector<SDValue, 4> InVals;
|
||||
Chain = LowerCall(Chain, Callee, CallConv, isVarArg, isTailCall,
|
||||
Outs, Ins, dl, DAG, InVals);
|
||||
Outs, OutVals, Ins, dl, DAG, InVals);
|
||||
|
||||
// Verify that the target's LowerCall behaved as expected.
|
||||
assert(Chain.getNode() && Chain.getValueType() == MVT::Other &&
|
||||
|
|
|
@ -1030,6 +1030,7 @@ ARMTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -1043,7 +1044,7 @@ ARMTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
// Check if it's really possible to do a tail call.
|
||||
isTailCall = IsEligibleForTailCallOptimization(Callee, CallConv,
|
||||
isVarArg, IsStructRet, MF.getFunction()->hasStructRetAttr(),
|
||||
Outs, Ins, DAG);
|
||||
Outs, OutVals, Ins, DAG);
|
||||
// We don't support GuaranteedTailCallOpt for ARM, only automatically
|
||||
// detected sibcalls.
|
||||
if (isTailCall) {
|
||||
|
@ -1083,7 +1084,7 @@ ARMTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
i != e;
|
||||
++i, ++realArgIdx) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
SDValue Arg = Outs[realArgIdx].Val;
|
||||
SDValue Arg = OutVals[realArgIdx];
|
||||
ISD::ArgFlagsTy Flags = Outs[realArgIdx].Flags;
|
||||
|
||||
// Promote the value if needed.
|
||||
|
@ -1377,6 +1378,7 @@ ARMTargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
bool isCalleeStructRet,
|
||||
bool isCallerStructRet,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
SelectionDAG& DAG) const {
|
||||
const Function *CallerF = DAG.getMachineFunction().getFunction();
|
||||
|
@ -1470,7 +1472,7 @@ ARMTargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
++i, ++realArgIdx) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
EVT RegVT = VA.getLocVT();
|
||||
SDValue Arg = Outs[realArgIdx].Val;
|
||||
SDValue Arg = OutVals[realArgIdx];
|
||||
ISD::ArgFlagsTy Flags = Outs[realArgIdx].Flags;
|
||||
if (VA.getLocInfo() == CCValAssign::Indirect)
|
||||
return false;
|
||||
|
@ -1505,6 +1507,7 @@ SDValue
|
|||
ARMTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of the return value to a location.
|
||||
|
@ -1535,7 +1538,7 @@ ARMTargetLowering::LowerReturn(SDValue Chain,
|
|||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
SDValue Arg = Outs[realRVLocIdx].Val;
|
||||
SDValue Arg = OutVals[realRVLocIdx];
|
||||
|
||||
switch (VA.getLocInfo()) {
|
||||
default: llvm_unreachable("Unknown loc info!");
|
||||
|
|
|
@ -337,6 +337,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -350,12 +351,14 @@ namespace llvm {
|
|||
bool isCalleeStructRet,
|
||||
bool isCallerStructRet,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
SelectionDAG& DAG) const;
|
||||
virtual SDValue
|
||||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
SDValue getARMCmp(SDValue LHS, SDValue RHS, ISD::CondCode CC,
|
||||
|
|
|
@ -224,6 +224,7 @@ AlphaTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -251,7 +252,7 @@ AlphaTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
@ -470,6 +471,7 @@ SDValue
|
|||
AlphaTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
SDValue Copy = DAG.getCopyToReg(Chain, dl, Alpha::R26,
|
||||
|
@ -483,7 +485,7 @@ AlphaTargetLowering::LowerReturn(SDValue Chain,
|
|||
break;
|
||||
//return SDValue(); // ret void is legal
|
||||
case 1: {
|
||||
EVT ArgVT = Outs[0].Val.getValueType();
|
||||
EVT ArgVT = Outs[0].VT;
|
||||
unsigned ArgReg;
|
||||
if (ArgVT.isInteger())
|
||||
ArgReg = Alpha::R0;
|
||||
|
@ -492,13 +494,13 @@ AlphaTargetLowering::LowerReturn(SDValue Chain,
|
|||
ArgReg = Alpha::F0;
|
||||
}
|
||||
Copy = DAG.getCopyToReg(Copy, dl, ArgReg,
|
||||
Outs[0].Val, Copy.getValue(1));
|
||||
OutVals[0], Copy.getValue(1));
|
||||
if (DAG.getMachineFunction().getRegInfo().liveout_empty())
|
||||
DAG.getMachineFunction().getRegInfo().addLiveOut(ArgReg);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
EVT ArgVT = Outs[0].Val.getValueType();
|
||||
EVT ArgVT = Outs[0].VT;
|
||||
unsigned ArgReg1, ArgReg2;
|
||||
if (ArgVT.isInteger()) {
|
||||
ArgReg1 = Alpha::R0;
|
||||
|
@ -509,13 +511,13 @@ AlphaTargetLowering::LowerReturn(SDValue Chain,
|
|||
ArgReg2 = Alpha::F1;
|
||||
}
|
||||
Copy = DAG.getCopyToReg(Copy, dl, ArgReg1,
|
||||
Outs[0].Val, Copy.getValue(1));
|
||||
OutVals[0], 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, dl, ArgReg2,
|
||||
Outs[1].Val, Copy.getValue(1));
|
||||
OutVals[1], Copy.getValue(1));
|
||||
if (std::find(DAG.getMachineFunction().getRegInfo().liveout_begin(),
|
||||
DAG.getMachineFunction().getRegInfo().liveout_end(), ArgReg2)
|
||||
== DAG.getMachineFunction().getRegInfo().liveout_end())
|
||||
|
|
|
@ -121,6 +121,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -129,6 +130,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -219,6 +219,7 @@ SDValue
|
|||
BlackfinTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of the return value to locations.
|
||||
|
@ -244,7 +245,7 @@ BlackfinTargetLowering::LowerReturn(SDValue Chain,
|
|||
for (unsigned i = 0; i != RVLocs.size(); ++i) {
|
||||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
SDValue Opi = Outs[i].Val;
|
||||
SDValue Opi = OutVals[i];
|
||||
|
||||
// Expand to i32 if necessary
|
||||
switch (VA.getLocInfo()) {
|
||||
|
@ -277,6 +278,7 @@ BlackfinTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -300,7 +302,7 @@ BlackfinTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
// Walk the register/memloc assignments, inserting copies/loads.
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
|
|
@ -63,6 +63,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -71,6 +72,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
};
|
||||
} // end namespace llvm
|
||||
|
|
|
@ -1135,6 +1135,7 @@ SPUTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -1166,7 +1167,7 @@ SPUTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
SmallVector<SDValue, 8> MemOpChains;
|
||||
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// PtrOff will be used to store the current argument to the stack if a
|
||||
// register cannot be found for it.
|
||||
|
@ -1339,6 +1340,7 @@ SDValue
|
|||
SPUTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
@ -1360,7 +1362,7 @@ SPUTargetLowering::LowerReturn(SDValue Chain,
|
|||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
Flag = Chain.getValue(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -159,6 +159,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -167,6 +168,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -525,6 +525,7 @@ SDValue MBlazeTargetLowering::
|
|||
LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv,
|
||||
bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -556,7 +557,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv,
|
|||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
EVT RegVT = VA.getLocVT();
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
@ -835,6 +836,7 @@ LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
|
|||
SDValue MBlazeTargetLowering::
|
||||
LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
// CCValAssign - represent the assignment of
|
||||
// the return value to a location
|
||||
|
@ -863,7 +865,7 @@ LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
|
|||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
|
||||
// guarantee that all emitted copies are
|
||||
// stuck together, avoiding something bad
|
||||
|
|
|
@ -109,6 +109,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -117,6 +118,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
virtual MachineBasicBlock *
|
||||
|
|
|
@ -278,6 +278,7 @@ MSP430TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -290,7 +291,7 @@ MSP430TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
case CallingConv::Fast:
|
||||
case CallingConv::C:
|
||||
return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall,
|
||||
Outs, Ins, dl, DAG, InVals);
|
||||
Outs, OutVals, Ins, dl, DAG, InVals);
|
||||
case CallingConv::MSP430_INTR:
|
||||
report_fatal_error("ISRs cannot be called directly");
|
||||
return SDValue();
|
||||
|
@ -387,6 +388,7 @@ SDValue
|
|||
MSP430TargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of the return value to a location
|
||||
|
@ -421,7 +423,7 @@ MSP430TargetLowering::LowerReturn(SDValue Chain,
|
|||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
|
||||
// Guarantee that all emitted copies are stuck together,
|
||||
// avoiding something bad.
|
||||
|
@ -447,6 +449,7 @@ MSP430TargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg>
|
||||
&Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -471,7 +474,7 @@ MSP430TargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
|
|
@ -127,6 +127,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -155,6 +156,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -163,6 +165,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
virtual bool getPostIndexedAddressParts(SDNode *N, SDNode *Op,
|
||||
|
|
|
@ -767,6 +767,7 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -807,7 +808,7 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
|
||||
// Walk the register/memloc assignments, inserting copies/loads.
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
|
@ -1168,6 +1169,7 @@ SDValue
|
|||
MipsTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of
|
||||
|
@ -1197,7 +1199,7 @@ MipsTargetLowering::LowerReturn(SDValue Chain,
|
|||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
|
||||
// guarantee that all emitted copies are
|
||||
// stuck together, avoiding something bad
|
||||
|
|
|
@ -120,6 +120,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -128,6 +129,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
virtual MachineBasicBlock *
|
||||
|
|
|
@ -1121,6 +1121,7 @@ SDValue PIC16TargetLowering::
|
|||
LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
|
||||
SDValue DataAddr_Lo, SDValue DataAddr_Hi,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
unsigned NumOps = Outs.size();
|
||||
|
@ -1137,7 +1138,7 @@ LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
|
|||
unsigned RetVals = Ins.size();
|
||||
for (unsigned i = 0, ArgOffset = RetVals; i < NumOps; i++) {
|
||||
// Get the arguments
|
||||
Arg = Outs[i].Val;
|
||||
Arg = OutVals[i];
|
||||
|
||||
Ops.clear();
|
||||
Ops.push_back(Chain);
|
||||
|
@ -1159,6 +1160,7 @@ LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
|
|||
SDValue PIC16TargetLowering::
|
||||
LowerDirectCallArguments(SDValue ArgLabel, SDValue Chain, SDValue InFlag,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
unsigned NumOps = Outs.size();
|
||||
std::string Name;
|
||||
|
@ -1184,7 +1186,7 @@ LowerDirectCallArguments(SDValue ArgLabel, SDValue Chain, SDValue InFlag,
|
|||
SDVTList Tys = DAG.getVTList(MVT::Other, MVT::Flag);
|
||||
for (unsigned i=0, Offset = 0; i<NumOps; i++) {
|
||||
// Get the argument
|
||||
Arg = Outs[i].Val;
|
||||
Arg = OutVals[i];
|
||||
StoreOffset = (Offset + AddressOffset);
|
||||
|
||||
// Store the argument on frame
|
||||
|
@ -1283,6 +1285,7 @@ SDValue
|
|||
PIC16TargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// Number of values to return
|
||||
|
@ -1299,7 +1302,7 @@ PIC16TargetLowering::LowerReturn(SDValue Chain,
|
|||
SDValue BS = DAG.getConstant(1, MVT::i8);
|
||||
SDValue RetVal;
|
||||
for(unsigned i=0;i<NumRet; ++i) {
|
||||
RetVal = Outs[i].Val;
|
||||
RetVal = OutVals[i];
|
||||
Chain = DAG.getNode (PIC16ISD::PIC16Store, dl, MVT::Other, Chain, RetVal,
|
||||
ES, BS,
|
||||
DAG.getConstant (i, MVT::i8));
|
||||
|
@ -1375,6 +1378,7 @@ PIC16TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -1462,12 +1466,13 @@ PIC16TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
SDValue CallArgs;
|
||||
if (IsDirectCall) {
|
||||
CallArgs = LowerDirectCallArguments(ArgLabel, Chain, OperFlag,
|
||||
Outs, dl, DAG);
|
||||
Outs, OutVals, dl, DAG);
|
||||
Chain = getChain(CallArgs);
|
||||
OperFlag = getOutFlag(CallArgs);
|
||||
} else {
|
||||
CallArgs = LowerIndirectCallArguments(Chain, OperFlag, DataAddr_Lo,
|
||||
DataAddr_Hi, Outs, Ins, dl, DAG);
|
||||
DataAddr_Hi, Outs, OutVals, Ins,
|
||||
dl, DAG);
|
||||
Chain = getChain(CallArgs);
|
||||
OperFlag = getOutFlag(CallArgs);
|
||||
}
|
||||
|
|
|
@ -106,12 +106,14 @@ namespace llvm {
|
|||
SDValue
|
||||
LowerDirectCallArguments(SDValue ArgLabel, SDValue Chain, SDValue InFlag,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
SDValue
|
||||
LowerIndirectCallArguments(SDValue Chain, SDValue InFlag,
|
||||
SDValue DataAddr_Lo, SDValue DataAddr_Hi,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
|
@ -143,6 +145,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -151,6 +154,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
SDValue ExpandStore(SDNode *N, SelectionDAG &DAG) const;
|
||||
|
|
|
@ -2136,6 +2136,7 @@ CalculateParameterAndLinkageAreaSize(SelectionDAG &DAG,
|
|||
unsigned CC,
|
||||
const SmallVectorImpl<ISD::OutputArg>
|
||||
&Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
unsigned &nAltivecParamsAtEnd) {
|
||||
// Count how many bytes are to be pushed on the stack, including the linkage
|
||||
// area, and parameter passing area. We start with 24/48 bytes, which is
|
||||
|
@ -2152,9 +2153,9 @@ CalculateParameterAndLinkageAreaSize(SelectionDAG &DAG,
|
|||
// 16-byte aligned.
|
||||
nAltivecParamsAtEnd = 0;
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
ISD::ArgFlagsTy Flags = Outs[i].Flags;
|
||||
EVT ArgVT = Arg.getValueType();
|
||||
EVT ArgVT = Outs[i].VT;
|
||||
// Varargs Altivec parameters are padded to a 16 byte boundary.
|
||||
if (ArgVT==MVT::v4f32 || ArgVT==MVT::v4i32 ||
|
||||
ArgVT==MVT::v8i16 || ArgVT==MVT::v16i8) {
|
||||
|
@ -2704,6 +2705,7 @@ PPCTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -2713,11 +2715,11 @@ PPCTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
|
||||
if (PPCSubTarget.isSVR4ABI() && !PPCSubTarget.isPPC64()) {
|
||||
return LowerCall_SVR4(Chain, Callee, CallConv, isVarArg,
|
||||
isTailCall, Outs, Ins,
|
||||
isTailCall, Outs, OutVals, Ins,
|
||||
dl, DAG, InVals);
|
||||
} else {
|
||||
return LowerCall_Darwin(Chain, Callee, CallConv, isVarArg,
|
||||
isTailCall, Outs, Ins,
|
||||
isTailCall, Outs, OutVals, Ins,
|
||||
dl, DAG, InVals);
|
||||
}
|
||||
}
|
||||
|
@ -2727,6 +2729,7 @@ PPCTargetLowering::LowerCall_SVR4(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -2767,7 +2770,7 @@ PPCTargetLowering::LowerCall_SVR4(SDValue Chain, SDValue Callee,
|
|||
unsigned NumArgs = Outs.size();
|
||||
|
||||
for (unsigned i = 0; i != NumArgs; ++i) {
|
||||
EVT ArgVT = Outs[i].Val.getValueType();
|
||||
EVT ArgVT = Outs[i].VT;
|
||||
ISD::ArgFlagsTy ArgFlags = Outs[i].Flags;
|
||||
bool Result;
|
||||
|
||||
|
@ -2836,7 +2839,7 @@ PPCTargetLowering::LowerCall_SVR4(SDValue Chain, SDValue Callee,
|
|||
i != e;
|
||||
++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
ISD::ArgFlagsTy Flags = Outs[i].Flags;
|
||||
|
||||
if (Flags.isByVal()) {
|
||||
|
@ -2932,6 +2935,7 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -2959,7 +2963,7 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
|||
// prereserved space for [SP][CR][LR][3 x unused].
|
||||
unsigned NumBytes =
|
||||
CalculateParameterAndLinkageAreaSize(DAG, isPPC64, isVarArg, CallConv,
|
||||
Outs,
|
||||
Outs, OutVals,
|
||||
nAltivecParamsAtEnd);
|
||||
|
||||
// Calculate by how many bytes the stack has to be adjusted in case of tail
|
||||
|
@ -3023,7 +3027,7 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
|||
|
||||
SmallVector<SDValue, 8> MemOpChains;
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
ISD::ArgFlagsTy Flags = Outs[i].Flags;
|
||||
|
||||
// PtrOff will be used to store the current argument to the stack if a
|
||||
|
@ -3226,8 +3230,8 @@ PPCTargetLowering::LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
|||
ArgOffset = ((ArgOffset+15)/16)*16;
|
||||
ArgOffset += 12*16;
|
||||
for (unsigned i = 0; i != NumOps; ++i) {
|
||||
SDValue Arg = Outs[i].Val;
|
||||
EVT ArgType = Arg.getValueType();
|
||||
SDValue Arg = OutVals[i];
|
||||
EVT ArgType = Outs[i].VT;
|
||||
if (ArgType==MVT::v4f32 || ArgType==MVT::v4i32 ||
|
||||
ArgType==MVT::v8i16 || ArgType==MVT::v16i8) {
|
||||
if (++j > NumVRs) {
|
||||
|
@ -3295,6 +3299,7 @@ SDValue
|
|||
PPCTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
@ -3316,7 +3321,7 @@ PPCTargetLowering::LowerReturn(SDValue Chain,
|
|||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
Flag = Chain.getValue(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -435,6 +435,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -443,6 +444,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
SDValue
|
||||
|
@ -462,6 +464,7 @@ namespace llvm {
|
|||
LowerCall_Darwin(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -469,6 +472,7 @@ namespace llvm {
|
|||
LowerCall_SVR4(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
|
|
@ -38,6 +38,7 @@ SDValue
|
|||
SparcTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of the return value to locations.
|
||||
|
@ -66,7 +67,7 @@ SparcTargetLowering::LowerReturn(SDValue Chain,
|
|||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
|
||||
// Guarantee that all emitted copies are stuck together with flags.
|
||||
Flag = Chain.getValue(1);
|
||||
|
@ -262,6 +263,7 @@ SparcTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -283,7 +285,7 @@ SparcTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
// Count the size of the outgoing arguments.
|
||||
unsigned ArgsSize = 0;
|
||||
for (unsigned i = 0, e = Outs.size(); i != e; ++i) {
|
||||
switch (Outs[i].Val.getValueType().getSimpleVT().SimpleTy) {
|
||||
switch (Outs[i].VT.getSimpleVT().SimpleTy) {
|
||||
default: llvm_unreachable("Unknown value type!");
|
||||
case MVT::i1:
|
||||
case MVT::i8:
|
||||
|
@ -316,7 +318,7 @@ SparcTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
// Walk the register/memloc assignments, inserting copies/loads.
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
@ -358,8 +360,8 @@ SparcTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
unsigned ArgOffset = 68;
|
||||
|
||||
for (unsigned i = 0, e = Outs.size(); i != e; ++i) {
|
||||
SDValue Val = Outs[i].Val;
|
||||
EVT ObjectVT = Val.getValueType();
|
||||
SDValue Val = OutVals[i];
|
||||
EVT ObjectVT = Outs[i].VT;
|
||||
SDValue ValToStore(0, 0);
|
||||
unsigned ObjSize;
|
||||
switch (ObjectVT.getSimpleVT().SimpleTy) {
|
||||
|
|
|
@ -86,6 +86,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -94,6 +95,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
|
||||
|
|
|
@ -254,6 +254,7 @@ SystemZTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -266,7 +267,7 @@ SystemZTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
case CallingConv::Fast:
|
||||
case CallingConv::C:
|
||||
return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall,
|
||||
Outs, Ins, dl, DAG, InVals);
|
||||
Outs, OutVals, Ins, dl, DAG, InVals);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -372,6 +373,7 @@ SystemZTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg>
|
||||
&Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -402,7 +404,7 @@ SystemZTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
@ -550,6 +552,7 @@ SDValue
|
|||
SystemZTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of the return value to a location
|
||||
|
@ -575,7 +578,7 @@ SystemZTargetLowering::LowerReturn(SDValue Chain,
|
|||
// Copy the result values into the output registers.
|
||||
for (unsigned i = 0; i != RVLocs.size(); ++i) {
|
||||
CCValAssign &VA = RVLocs[i];
|
||||
SDValue ResValue = Outs[i].Val;
|
||||
SDValue ResValue = OutVals[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
// If this is an 8/16/32-bit value, it is really should be passed promoted
|
||||
|
|
|
@ -98,6 +98,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -126,6 +127,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -134,6 +136,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
const SystemZSubtarget &Subtarget;
|
||||
|
|
|
@ -1231,6 +1231,7 @@ SDValue
|
|||
X86TargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
|
||||
|
@ -1258,7 +1259,7 @@ X86TargetLowering::LowerReturn(SDValue Chain,
|
|||
for (unsigned i = 0; i != RVLocs.size(); ++i) {
|
||||
CCValAssign &VA = RVLocs[i];
|
||||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
SDValue ValToCopy = Outs[i].Val;
|
||||
SDValue ValToCopy = OutVals[i];
|
||||
|
||||
// Returns in ST0/ST1 are handled specially: these are pushed as operands to
|
||||
// the RET instruction and handled by the FP Stackifier.
|
||||
|
@ -1816,6 +1817,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -1828,7 +1830,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
// Check if it's really possible to do a tail call.
|
||||
isTailCall = IsEligibleForTailCallOptimization(Callee, CallConv,
|
||||
isVarArg, IsStructRet, MF.getFunction()->hasStructRetAttr(),
|
||||
Outs, Ins, DAG);
|
||||
Outs, OutVals, Ins, DAG);
|
||||
|
||||
// Sibcalls are automatically detected tailcalls which do not require
|
||||
// ABI changes.
|
||||
|
@ -1888,7 +1890,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
EVT RegVT = VA.getLocVT();
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
ISD::ArgFlagsTy Flags = Outs[i].Flags;
|
||||
bool isByVal = Flags.isByVal();
|
||||
|
||||
|
@ -2027,7 +2029,7 @@ X86TargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
if (VA.isRegLoc())
|
||||
continue;
|
||||
assert(VA.isMemLoc());
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
ISD::ArgFlagsTy Flags = Outs[i].Flags;
|
||||
// Create frame index.
|
||||
int32_t Offset = VA.getLocMemOffset()+FPDiff;
|
||||
|
@ -2320,6 +2322,7 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
bool isCalleeStructRet,
|
||||
bool isCallerStructRet,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
SelectionDAG& DAG) const {
|
||||
if (!IsTailCallConvention(CalleeCC) &&
|
||||
|
@ -2433,7 +2436,7 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
((X86TargetMachine&)getTargetMachine()).getInstrInfo();
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
ISD::ArgFlagsTy Flags = Outs[i].Flags;
|
||||
if (VA.getLocInfo() == CCValAssign::Indirect)
|
||||
return false;
|
||||
|
|
|
@ -652,6 +652,7 @@ namespace llvm {
|
|||
bool isCalleeStructRet,
|
||||
bool isCallerStructRet,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
SelectionDAG& DAG) const;
|
||||
bool IsCalleePop(bool isVarArg, CallingConv::ID CallConv) const;
|
||||
|
@ -734,6 +735,7 @@ namespace llvm {
|
|||
LowerCall(SDValue Chain, SDValue Callee,
|
||||
CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -742,6 +744,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
virtual bool
|
||||
|
|
|
@ -812,6 +812,7 @@ XCoreTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -826,7 +827,7 @@ XCoreTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
|||
case CallingConv::Fast:
|
||||
case CallingConv::C:
|
||||
return LowerCCCCallTo(Chain, Callee, CallConv, isVarArg, isTailCall,
|
||||
Outs, Ins, dl, DAG, InVals);
|
||||
Outs, OutVals, Ins, dl, DAG, InVals);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -839,6 +840,7 @@ XCoreTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
@ -866,7 +868,7 @@ XCoreTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
// Walk the register/memloc assignments, inserting copies/loads.
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
SDValue Arg = Outs[i].Val;
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
switch (VA.getLocInfo()) {
|
||||
|
@ -1146,6 +1148,7 @@ SDValue
|
|||
XCoreTargetLowering::LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
// CCValAssign - represent the assignment of
|
||||
|
@ -1175,7 +1178,7 @@ XCoreTargetLowering::LowerReturn(SDValue Chain,
|
|||
assert(VA.isRegLoc() && "Can only return in registers!");
|
||||
|
||||
Chain = DAG.getCopyToReg(Chain, dl, VA.getLocReg(),
|
||||
Outs[i].Val, Flag);
|
||||
OutVals[i], Flag);
|
||||
|
||||
// guarantee that all emitted copies are
|
||||
// stuck together, avoiding something bad
|
||||
|
|
|
@ -120,6 +120,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -178,6 +179,7 @@ namespace llvm {
|
|||
CallingConv::ID CallConv, bool isVarArg,
|
||||
bool &isTailCall,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
const SmallVectorImpl<ISD::InputArg> &Ins,
|
||||
DebugLoc dl, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const;
|
||||
|
@ -186,6 +188,7 @@ namespace llvm {
|
|||
LowerReturn(SDValue Chain,
|
||||
CallingConv::ID CallConv, bool isVarArg,
|
||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
const SmallVectorImpl<SDValue> &OutVals,
|
||||
DebugLoc dl, SelectionDAG &DAG) const;
|
||||
|
||||
virtual bool
|
||||
|
|
Loading…
Reference in New Issue