forked from OSchip/llvm-project
Remove the target machine from CCState. Previously it was only used
to get the subtarget and that's accessible from the MachineFunction now. This helps clear the way for smaller changes where we getting a subtarget will require passing in a MachineFunction/Function as well. llvm-svn: 214988
This commit is contained in:
parent
364d13170a
commit
b5217507c7
|
@ -174,7 +174,6 @@ private:
|
|||
CallingConv::ID CallingConv;
|
||||
bool IsVarArg;
|
||||
MachineFunction &MF;
|
||||
const TargetMachine &TM;
|
||||
const TargetRegisterInfo &TRI;
|
||||
SmallVectorImpl<CCValAssign> &Locs;
|
||||
LLVMContext &Context;
|
||||
|
@ -238,15 +237,13 @@ protected:
|
|||
|
||||
public:
|
||||
CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
|
||||
const TargetMachine &TM, SmallVectorImpl<CCValAssign> &locs,
|
||||
LLVMContext &C);
|
||||
SmallVectorImpl<CCValAssign> &locs, LLVMContext &C);
|
||||
|
||||
void addLoc(const CCValAssign &V) {
|
||||
Locs.push_back(V);
|
||||
}
|
||||
|
||||
LLVMContext &getContext() const { return Context; }
|
||||
const TargetMachine &getTarget() const { return TM; }
|
||||
MachineFunction &getMachineFunction() const { return MF; }
|
||||
CallingConv::ID getCallingConv() const { return CallingConv; }
|
||||
bool isVarArg() const { return IsVarArg; }
|
||||
|
|
|
@ -25,10 +25,9 @@
|
|||
using namespace llvm;
|
||||
|
||||
CCState::CCState(CallingConv::ID CC, bool isVarArg, MachineFunction &mf,
|
||||
const TargetMachine &tm, SmallVectorImpl<CCValAssign> &locs,
|
||||
LLVMContext &C)
|
||||
: CallingConv(CC), IsVarArg(isVarArg), MF(mf), TM(tm),
|
||||
TRI(*TM.getSubtargetImpl()->getRegisterInfo()), Locs(locs), Context(C),
|
||||
SmallVectorImpl<CCValAssign> &locs, LLVMContext &C)
|
||||
: CallingConv(CC), IsVarArg(isVarArg), MF(mf),
|
||||
TRI(*MF.getSubtarget().getRegisterInfo()), Locs(locs), Context(C),
|
||||
CallOrPrologue(Unknown) {
|
||||
// No stack is used.
|
||||
StackOffset = 0;
|
||||
|
@ -51,7 +50,7 @@ void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
|
|||
if (MinAlign > (int)Align)
|
||||
Align = MinAlign;
|
||||
MF.getFrameInfo()->ensureMaxAlignment(Align);
|
||||
TM.getSubtargetImpl()->getTargetLowering()->HandleByVal(this, Size, Align);
|
||||
MF.getSubtarget().getTargetLowering()->HandleByVal(this, Size, Align);
|
||||
Size = unsigned(RoundUpToAlignment(Size, MinAlign));
|
||||
unsigned Offset = AllocateStack(Size, Align);
|
||||
addLoc(CCValAssign::getMem(ValNo, ValVT, Offset, LocVT, LocInfo));
|
||||
|
|
|
@ -16,7 +16,7 @@ class CCIfAlign<string Align, CCAction A> :
|
|||
CCIf<!strconcat("ArgFlags.getOrigAlign() == ", Align), A>;
|
||||
/// CCIfBigEndian - Match only if we're in big endian mode.
|
||||
class CCIfBigEndian<CCAction A> :
|
||||
CCIf<"State.getTarget().getSubtargetImpl()->getDataLayout()->isBigEndian()", A>;
|
||||
CCIf<"State.getMachineFunction().getSubtarget().getDataLayout()->isBigEndian()", A>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// ARM AAPCS64 Calling Convention
|
||||
|
|
|
@ -1421,7 +1421,7 @@ bool AArch64FastISel::ProcessCallArgs(CallLoweringInfo &CLI,
|
|||
unsigned &NumBytes) {
|
||||
CallingConv::ID CC = CLI.CallConv;
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CC, false, *FuncInfo.MF, TM, ArgLocs, *Context);
|
||||
CCState CCInfo(CC, false, *FuncInfo.MF, ArgLocs, *Context);
|
||||
CCInfo.AnalyzeCallOperands(OutVTs, CLI.OutFlags, CCAssignFnForCall(CC));
|
||||
|
||||
// Get a count of how many bytes are to be pushed on the stack.
|
||||
|
@ -1514,7 +1514,7 @@ bool AArch64FastISel::FinishCall(CallLoweringInfo &CLI, MVT RetVT,
|
|||
// Now the return value.
|
||||
if (RetVT != MVT::isVoid) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CC, false, *FuncInfo.MF, TM, RVLocs, *Context);
|
||||
CCState CCInfo(CC, false, *FuncInfo.MF, RVLocs, *Context);
|
||||
CCInfo.AnalyzeCallResult(RetVT, CCAssignFnForCall(CC));
|
||||
|
||||
// Only handle a single return value.
|
||||
|
@ -2068,8 +2068,7 @@ bool AArch64FastISel::SelectRet(const Instruction *I) {
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ValLocs;
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, TM, ValLocs,
|
||||
I->getContext());
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, ValLocs, I->getContext());
|
||||
CCAssignFn *RetCC = CC == CallingConv::WebKit_JS ? RetCC_AArch64_WebKit_JS
|
||||
: RetCC_AArch64_AAPCS;
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC);
|
||||
|
|
|
@ -1674,8 +1674,8 @@ SDValue AArch64TargetLowering::LowerFormalArguments(
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// At this point, Ins[].VT may already be promoted to i32. To correctly
|
||||
// handle passing i8 as i8 instead of i32 on stack, we pass in both i32 and
|
||||
|
@ -1946,8 +1946,8 @@ SDValue AArch64TargetLowering::LowerCallResult(
|
|||
: RetCC_AArch64_AAPCS;
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeCallResult(Ins, RetCC);
|
||||
|
||||
// Copy all of the result registers out of their specified physreg.
|
||||
|
@ -2033,8 +2033,8 @@ bool AArch64TargetLowering::isEligibleForTailCallOptimization(
|
|||
// FIXME: for now we take the most conservative of these in both cases:
|
||||
// disallow all variadic memory operands.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForCall(CalleeCC, true));
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i)
|
||||
|
@ -2046,13 +2046,13 @@ bool AArch64TargetLowering::isEligibleForTailCallOptimization(
|
|||
// results are returned in the same way as what the caller expects.
|
||||
if (!CCMatch) {
|
||||
SmallVector<CCValAssign, 16> RVLocs1;
|
||||
CCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs1, *DAG.getContext());
|
||||
CCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(), RVLocs1,
|
||||
*DAG.getContext());
|
||||
CCInfo1.AnalyzeCallResult(Ins, CCAssignFnForCall(CalleeCC, isVarArg));
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs2;
|
||||
CCState CCInfo2(CallerCC, false, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs2, *DAG.getContext());
|
||||
CCState CCInfo2(CallerCC, false, DAG.getMachineFunction(), RVLocs2,
|
||||
*DAG.getContext());
|
||||
CCInfo2.AnalyzeCallResult(Ins, CCAssignFnForCall(CallerCC, isVarArg));
|
||||
|
||||
if (RVLocs1.size() != RVLocs2.size())
|
||||
|
@ -2077,8 +2077,8 @@ bool AArch64TargetLowering::isEligibleForTailCallOptimization(
|
|||
return true;
|
||||
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
CCInfo.AnalyzeCallOperands(Outs, CCAssignFnForCall(CalleeCC, isVarArg));
|
||||
|
||||
|
@ -2175,8 +2175,8 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
if (IsVarArg) {
|
||||
// Handle fixed and variable vector arguments differently.
|
||||
|
@ -2500,7 +2500,7 @@ bool AArch64TargetLowering::CanLowerReturn(
|
|||
? RetCC_AArch64_WebKit_JS
|
||||
: RetCC_AArch64_AAPCS;
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(), RVLocs, Context);
|
||||
CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
|
||||
return CCInfo.CheckReturn(Outs, RetCC);
|
||||
}
|
||||
|
||||
|
@ -2514,8 +2514,8 @@ AArch64TargetLowering::LowerReturn(SDValue Chain, CallingConv::ID CallConv,
|
|||
? RetCC_AArch64_WebKit_JS
|
||||
: RetCC_AArch64_AAPCS;
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC);
|
||||
|
||||
// Copy the result values into the output registers.
|
||||
|
|
|
@ -1885,7 +1885,7 @@ bool ARMFastISel::ProcessCallArgs(SmallVectorImpl<Value*> &Args,
|
|||
unsigned &NumBytes,
|
||||
bool isVarArg) {
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CC, isVarArg, *FuncInfo.MF, TM, ArgLocs, *Context);
|
||||
CCState CCInfo(CC, isVarArg, *FuncInfo.MF, ArgLocs, *Context);
|
||||
CCInfo.AnalyzeCallOperands(ArgVTs, ArgFlags,
|
||||
CCAssignFnForCall(CC, false, isVarArg));
|
||||
|
||||
|
@ -2034,7 +2034,7 @@ bool ARMFastISel::FinishCall(MVT RetVT, SmallVectorImpl<unsigned> &UsedRegs,
|
|||
// Now the return value.
|
||||
if (RetVT != MVT::isVoid) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CC, isVarArg, *FuncInfo.MF, TM, RVLocs, *Context);
|
||||
CCState CCInfo(CC, isVarArg, *FuncInfo.MF, RVLocs, *Context);
|
||||
CCInfo.AnalyzeCallResult(RetVT, CCAssignFnForCall(CC, true, isVarArg));
|
||||
|
||||
// Copy all of the result registers out of their specified physreg.
|
||||
|
@ -2095,7 +2095,7 @@ bool ARMFastISel::SelectRet(const Instruction *I) {
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ValLocs;
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, TM, ValLocs,I->getContext());
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, ValLocs, I->getContext());
|
||||
CCInfo.AnalyzeReturn(Outs, CCAssignFnForCall(CC, true /* is Ret */,
|
||||
F.isVarArg()));
|
||||
|
||||
|
@ -2200,7 +2200,7 @@ bool ARMFastISel::ARMEmitLibcall(const Instruction *I, RTLIB::Libcall Call) {
|
|||
// Can't handle non-double multi-reg retvals.
|
||||
if (RetVT != MVT::isVoid && RetVT != MVT::i32) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CC, false, *FuncInfo.MF, TM, RVLocs, *Context);
|
||||
CCState CCInfo(CC, false, *FuncInfo.MF, RVLocs, *Context);
|
||||
CCInfo.AnalyzeCallResult(RetVT, CCAssignFnForCall(CC, true, false));
|
||||
if (RVLocs.size() >= 2 && RetVT != MVT::f64)
|
||||
return false;
|
||||
|
@ -2311,7 +2311,7 @@ bool ARMFastISel::SelectCall(const Instruction *I,
|
|||
if (RetVT != MVT::isVoid && RetVT != MVT::i1 && RetVT != MVT::i8 &&
|
||||
RetVT != MVT::i16 && RetVT != MVT::i32) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CC, isVarArg, *FuncInfo.MF, TM, RVLocs, *Context);
|
||||
CCState CCInfo(CC, isVarArg, *FuncInfo.MF, RVLocs, *Context);
|
||||
CCInfo.AnalyzeCallResult(RetVT, CCAssignFnForCall(CC, true, isVarArg));
|
||||
if (RVLocs.size() >= 2 && RetVT != MVT::f64)
|
||||
return false;
|
||||
|
|
|
@ -70,9 +70,9 @@ namespace {
|
|||
class ARMCCState : public CCState {
|
||||
public:
|
||||
ARMCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
|
||||
const TargetMachine &TM, SmallVectorImpl<CCValAssign> &locs,
|
||||
LLVMContext &C, ParmContext PC)
|
||||
: CCState(CC, isVarArg, MF, TM, locs, C) {
|
||||
SmallVectorImpl<CCValAssign> &locs, LLVMContext &C,
|
||||
ParmContext PC)
|
||||
: CCState(CC, isVarArg, MF, locs, C) {
|
||||
assert(((PC == Call) || (PC == Prologue)) &&
|
||||
"ARMCCState users must specify whether their context is call"
|
||||
"or prologue generation.");
|
||||
|
@ -1269,8 +1269,8 @@ ARMTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
|
|||
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext(), Call);
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext(), Call);
|
||||
CCInfo.AnalyzeCallResult(Ins,
|
||||
CCAssignFnForNode(CallConv, /* Return*/ true,
|
||||
isVarArg));
|
||||
|
@ -1430,8 +1430,8 @@ ARMTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext(), Call);
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext(), Call);
|
||||
CCInfo.AnalyzeCallOperands(Outs,
|
||||
CCAssignFnForNode(CallConv, /* Return*/ false,
|
||||
isVarArg));
|
||||
|
@ -1961,13 +1961,13 @@ ARMTargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
// results are returned in the same way as what the caller expects.
|
||||
if (!CCMatch) {
|
||||
SmallVector<CCValAssign, 16> RVLocs1;
|
||||
ARMCCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs1, *DAG.getContext(), Call);
|
||||
ARMCCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(), RVLocs1,
|
||||
*DAG.getContext(), Call);
|
||||
CCInfo1.AnalyzeCallResult(Ins, CCAssignFnForNode(CalleeCC, true, isVarArg));
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs2;
|
||||
ARMCCState CCInfo2(CallerCC, false, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs2, *DAG.getContext(), Call);
|
||||
ARMCCState CCInfo2(CallerCC, false, DAG.getMachineFunction(), RVLocs2,
|
||||
*DAG.getContext(), Call);
|
||||
CCInfo2.AnalyzeCallResult(Ins, CCAssignFnForNode(CallerCC, true, isVarArg));
|
||||
|
||||
if (RVLocs1.size() != RVLocs2.size())
|
||||
|
@ -2001,8 +2001,8 @@ ARMTargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
// Check if stack adjustment is needed. For now, do not do this if any
|
||||
// argument is passed on the stack.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
ARMCCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext(), Call);
|
||||
ARMCCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext(), Call);
|
||||
CCInfo.AnalyzeCallOperands(Outs,
|
||||
CCAssignFnForNode(CalleeCC, false, isVarArg));
|
||||
if (CCInfo.getNextStackOffset()) {
|
||||
|
@ -2056,7 +2056,7 @@ ARMTargetLowering::CanLowerReturn(CallingConv::ID CallConv,
|
|||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
LLVMContext &Context) const {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(), RVLocs, Context);
|
||||
CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
|
||||
return CCInfo.CheckReturn(Outs, CCAssignFnForNode(CallConv, /*Return=*/true,
|
||||
isVarArg));
|
||||
}
|
||||
|
@ -2104,8 +2104,8 @@ ARMTargetLowering::LowerReturn(SDValue Chain,
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
||||
// CCState - Info about the registers and stack slots.
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext(), Call);
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext(), Call);
|
||||
|
||||
// Analyze outgoing return values.
|
||||
CCInfo.AnalyzeReturn(Outs, CCAssignFnForNode(CallConv, /* Return */ true,
|
||||
|
@ -2941,8 +2941,8 @@ ARMTargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext(), Prologue);
|
||||
ARMCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext(), Prologue);
|
||||
CCInfo.AnalyzeFormalArguments(Ins,
|
||||
CCAssignFnForNode(CallConv, /* Return*/ false,
|
||||
isVarArg));
|
||||
|
|
|
@ -51,9 +51,9 @@ class HexagonCCState : public CCState {
|
|||
|
||||
public:
|
||||
HexagonCCState(CallingConv::ID CC, bool isVarArg, MachineFunction &MF,
|
||||
const TargetMachine &TM, SmallVectorImpl<CCValAssign> &locs,
|
||||
LLVMContext &C, int NumNamedVarArgParams)
|
||||
: CCState(CC, isVarArg, MF, TM, locs, C),
|
||||
SmallVectorImpl<CCValAssign> &locs, LLVMContext &C,
|
||||
int NumNamedVarArgParams)
|
||||
: CCState(CC, isVarArg, MF, locs, C),
|
||||
NumNamedVarArgParams(NumNamedVarArgParams) {}
|
||||
|
||||
int getNumNamedVarArgParams() const { return NumNamedVarArgParams; }
|
||||
|
@ -322,8 +322,8 @@ HexagonTargetLowering::LowerReturn(SDValue Chain,
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Analyze return values of ISD::RET
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_Hexagon);
|
||||
|
@ -372,8 +372,8 @@ HexagonTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
|
|||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
CCInfo.AnalyzeCallResult(Ins, RetCC_Hexagon);
|
||||
|
||||
|
@ -427,9 +427,8 @@ HexagonTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
HexagonCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext(),
|
||||
NumNamedVarArgParams);
|
||||
HexagonCCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext(), NumNamedVarArgParams);
|
||||
|
||||
if (NumNamedVarArgParams > 0)
|
||||
CCInfo.AnalyzeCallOperands(Outs, CC_Hexagon_VarArg);
|
||||
|
@ -843,8 +842,8 @@ const {
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
CCInfo.AnalyzeFormalArguments(Ins, CC_Hexagon);
|
||||
|
||||
|
|
|
@ -437,8 +437,8 @@ MSP430TargetLowering::LowerCCCArguments(SDValue Chain,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
AnalyzeArguments(CCInfo, ArgLocs, Ins);
|
||||
|
||||
// Create frame index for the start of the first vararg value
|
||||
|
@ -533,8 +533,8 @@ MSP430TargetLowering::LowerReturn(SDValue Chain,
|
|||
report_fatal_error("ISRs cannot return any value");
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Analize return values.
|
||||
AnalyzeReturnValues(CCInfo, RVLocs, Outs);
|
||||
|
@ -583,8 +583,8 @@ MSP430TargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
AnalyzeArguments(CCInfo, ArgLocs, Outs);
|
||||
|
||||
// Get a count of how many bytes are to be pushed on the stack.
|
||||
|
@ -719,8 +719,8 @@ MSP430TargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
|
|||
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
AnalyzeReturnValues(CCInfo, RVLocs, Ins);
|
||||
|
||||
|
|
|
@ -10,8 +10,11 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/// CCIfSubtarget - Match if the current subtarget has a feature F.
|
||||
class CCIfSubtarget<string F, CCAction A>:
|
||||
CCIf<!strconcat("State.getTarget().getSubtarget<MipsSubtarget>().", F), A>;
|
||||
class CCIfSubtarget<string F, CCAction A>
|
||||
: CCIf<!strconcat("static_cast<const MipsSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).",
|
||||
F),
|
||||
A>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Mips O32 Calling Convention
|
||||
|
|
|
@ -2480,8 +2480,8 @@ MipsTargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
MipsCC::SpecialCallingConvType SpecialCallingConv =
|
||||
getSpecialCallingConv(Callee);
|
||||
MipsCC MipsCCInfo(CallConv, Subtarget.isABI_O32(), Subtarget.isFP64bit(),
|
||||
|
@ -2684,8 +2684,8 @@ MipsTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
|
|||
const Type *RetTy) const {
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
MipsCC MipsCCInfo(CallConv, Subtarget.isABI_O32(), Subtarget.isFP64bit(),
|
||||
CCInfo);
|
||||
|
||||
|
@ -2732,8 +2732,8 @@ MipsTargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
MipsCC MipsCCInfo(CallConv, Subtarget.isABI_O32(), Subtarget.isFP64bit(),
|
||||
CCInfo);
|
||||
Function::const_arg_iterator FuncArg =
|
||||
|
@ -2868,8 +2868,7 @@ MipsTargetLowering::CanLowerReturn(CallingConv::ID CallConv,
|
|||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
LLVMContext &Context) const {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, MF, getTargetMachine(),
|
||||
RVLocs, Context);
|
||||
CCState CCInfo(CallConv, IsVarArg, MF, RVLocs, Context);
|
||||
return CCInfo.CheckReturn(Outs, RetCC_Mips);
|
||||
}
|
||||
|
||||
|
@ -2885,8 +2884,7 @@ MipsTargetLowering::LowerReturn(SDValue Chain,
|
|||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CallConv, IsVarArg, MF, getTargetMachine(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, MF, RVLocs, *DAG.getContext());
|
||||
MipsCC MipsCCInfo(CallConv, Subtarget.isABI_O32(), Subtarget.isFP64bit(),
|
||||
CCInfo);
|
||||
|
||||
|
|
|
@ -14,9 +14,15 @@
|
|||
|
||||
/// CCIfSubtarget - Match if the current subtarget has a feature F.
|
||||
class CCIfSubtarget<string F, CCAction A>
|
||||
: CCIf<!strconcat("State.getTarget().getSubtarget<PPCSubtarget>().", F), A>;
|
||||
: CCIf<!strconcat("static_cast<const PPCSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).",
|
||||
F),
|
||||
A>;
|
||||
class CCIfNotSubtarget<string F, CCAction A>
|
||||
: CCIf<!strconcat("!State.getTarget().getSubtarget<PPCSubtarget>().", F), A>;
|
||||
: CCIf<!strconcat("!static_cast<const PPCSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).",
|
||||
F),
|
||||
A>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Return Value Calling Convention
|
||||
|
|
|
@ -1199,7 +1199,7 @@ bool PPCFastISel::processCallArgs(SmallVectorImpl<Value*> &Args,
|
|||
unsigned &NumBytes,
|
||||
bool IsVarArg) {
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, TM, ArgLocs, *Context);
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, ArgLocs, *Context);
|
||||
|
||||
// Reserve space for the linkage area on the stack.
|
||||
bool isELFv2ABI = PPCSubTarget->isELFv2ABI();
|
||||
|
@ -1320,7 +1320,7 @@ void PPCFastISel::finishCall(MVT RetVT, SmallVectorImpl<unsigned> &UsedRegs,
|
|||
// any real difficulties there.
|
||||
if (RetVT != MVT::isVoid) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, TM, RVLocs, *Context);
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, RVLocs, *Context);
|
||||
CCInfo.AnalyzeCallResult(RetVT, RetCC_PPC64_ELF_FIS);
|
||||
CCValAssign &VA = RVLocs[0];
|
||||
assert(RVLocs.size() == 1 && "No support for multi-reg return values!");
|
||||
|
@ -1410,7 +1410,7 @@ bool PPCFastISel::SelectCall(const Instruction *I) {
|
|||
RetVT != MVT::i32 && RetVT != MVT::i64 && RetVT != MVT::f32 &&
|
||||
RetVT != MVT::f64) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, TM, RVLocs, *Context);
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, RVLocs, *Context);
|
||||
CCInfo.AnalyzeCallResult(RetVT, RetCC_PPC64_ELF_FIS);
|
||||
if (RVLocs.size() > 1)
|
||||
return false;
|
||||
|
@ -1537,7 +1537,7 @@ bool PPCFastISel::SelectRet(const Instruction *I) {
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ValLocs;
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, TM, ValLocs, *Context);
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, ValLocs, *Context);
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_PPC64_ELF_FIS);
|
||||
const Value *RV = Ret->getOperand(0);
|
||||
|
||||
|
|
|
@ -2386,8 +2386,8 @@ PPCTargetLowering::LowerFormalArguments_32SVR4(
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Reserve space for the linkage area on the stack.
|
||||
unsigned LinkageSize = PPCFrameLowering::getLinkageSize(false, false, false);
|
||||
|
@ -2461,7 +2461,7 @@ PPCTargetLowering::LowerFormalArguments_32SVR4(
|
|||
// caller's stack frame, right above the parameter list area.
|
||||
SmallVector<CCValAssign, 16> ByValArgLocs;
|
||||
CCState CCByValInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ByValArgLocs, *DAG.getContext());
|
||||
ByValArgLocs, *DAG.getContext());
|
||||
|
||||
// Reserve stack space for the allocations in CCInfo.
|
||||
CCByValInfo.AllocateStack(CCInfo.getNextStackOffset(), PtrByteSize);
|
||||
|
@ -3743,8 +3743,8 @@ PPCTargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
|
|||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCRetInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCRetInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCRetInfo.AnalyzeCallResult(Ins, RetCC_PPC);
|
||||
|
||||
// Copy all of the result registers out of their specified physreg.
|
||||
|
@ -3959,8 +3959,8 @@ PPCTargetLowering::LowerCall_32SVR4(SDValue Chain, SDValue Callee,
|
|||
|
||||
// Assign locations to all of the outgoing arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Reserve space for the linkage area on the stack.
|
||||
CCInfo.AllocateStack(PPCFrameLowering::getLinkageSize(false, false, false),
|
||||
|
@ -4001,7 +4001,7 @@ PPCTargetLowering::LowerCall_32SVR4(SDValue Chain, SDValue Callee,
|
|||
// Assign locations to all of the outgoing aggregate by value arguments.
|
||||
SmallVector<CCValAssign, 16> ByValArgLocs;
|
||||
CCState CCByValInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ByValArgLocs, *DAG.getContext());
|
||||
ByValArgLocs, *DAG.getContext());
|
||||
|
||||
// Reserve stack space for the allocations in CCInfo.
|
||||
CCByValInfo.AllocateStack(CCInfo.getNextStackOffset(), PtrByteSize);
|
||||
|
@ -5037,8 +5037,7 @@ PPCTargetLowering::CanLowerReturn(CallingConv::ID CallConv,
|
|||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
LLVMContext &Context) const {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(),
|
||||
RVLocs, Context);
|
||||
CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
|
||||
return CCInfo.CheckReturn(Outs, RetCC_PPC);
|
||||
}
|
||||
|
||||
|
@ -5050,8 +5049,8 @@ PPCTargetLowering::LowerReturn(SDValue Chain,
|
|||
SDLoc dl, SelectionDAG &DAG) const {
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_PPC);
|
||||
|
||||
SDValue Flag;
|
||||
|
|
|
@ -59,16 +59,24 @@ def CC_AMDGPU_Kernel : CallingConv<[
|
|||
]>;
|
||||
|
||||
def CC_AMDGPU : CallingConv<[
|
||||
CCIf<"State.getTarget().getSubtarget<AMDGPUSubtarget>().getGeneration() >= "
|
||||
"AMDGPUSubtarget::SOUTHERN_ISLANDS && "
|
||||
"State.getMachineFunction().getInfo<SIMachineFunctionInfo>()->"#
|
||||
"getShaderType() == ShaderType::COMPUTE", CCDelegateTo<CC_AMDGPU_Kernel>>,
|
||||
CCIf<"State.getTarget().getSubtarget<AMDGPUSubtarget>().getGeneration() < "
|
||||
"AMDGPUSubtarget::SOUTHERN_ISLANDS && "
|
||||
"State.getMachineFunction().getInfo<R600MachineFunctionInfo>()->"
|
||||
"getShaderType() == ShaderType::COMPUTE", CCDelegateTo<CC_AMDGPU_Kernel>>,
|
||||
CCIf<"State.getTarget().getSubtarget<AMDGPUSubtarget>()"#
|
||||
".getGeneration() >= AMDGPUSubtarget::SOUTHERN_ISLANDS", CCDelegateTo<CC_SI>>,
|
||||
CCIf<"State.getTarget().getSubtarget<AMDGPUSubtarget>()"#
|
||||
".getGeneration() < AMDGPUSubtarget::SOUTHERN_ISLANDS", CCDelegateTo<CC_R600>>
|
||||
CCIf<"static_cast<const AMDGPUSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).getGeneration() >="
|
||||
"AMDGPUSubtarget::SOUTHERN_ISLANDS && "
|
||||
"State.getMachineFunction().getInfo<SIMachineFunctionInfo>()"
|
||||
"->getShaderType() == ShaderType::COMPUTE",
|
||||
CCDelegateTo<CC_AMDGPU_Kernel>>,
|
||||
CCIf<"static_cast<const AMDGPUSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).getGeneration() < "
|
||||
"AMDGPUSubtarget::SOUTHERN_ISLANDS && "
|
||||
"State.getMachineFunction().getInfo<R600MachineFunctionInfo>()"
|
||||
"->getShaderType() == ShaderType::COMPUTE",
|
||||
CCDelegateTo<CC_AMDGPU_Kernel>>,
|
||||
CCIf<"static_cast<const AMDGPUSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).getGeneration() >= "
|
||||
"AMDGPUSubtarget::SOUTHERN_ISLANDS",
|
||||
CCDelegateTo<CC_SI>>,
|
||||
CCIf<"static_cast<const AMDGPUSubtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).getGeneration() < "
|
||||
"AMDGPUSubtarget::SOUTHERN_ISLANDS",
|
||||
CCDelegateTo<CC_R600>>
|
||||
]>;
|
||||
|
|
|
@ -1692,8 +1692,8 @@ SDValue R600TargetLowering::LowerFormalArguments(
|
|||
SDLoc DL, SelectionDAG &DAG,
|
||||
SmallVectorImpl<SDValue> &InVals) const {
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
MachineFunction &MF = DAG.getMachineFunction();
|
||||
unsigned ShaderType = MF.getInfo<R600MachineFunctionInfo>()->getShaderType();
|
||||
|
||||
|
|
|
@ -395,8 +395,8 @@ SDValue SITargetLowering::LowerFormalArguments(
|
|||
}
|
||||
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// At least one interpolation mode must be enabled or else the GPU will hang.
|
||||
if (Info->getShaderType() == ShaderType::PIXEL &&
|
||||
|
|
|
@ -190,8 +190,8 @@ SparcTargetLowering::LowerReturn_32(SDValue Chain,
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Analyze return values.
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_Sparc32);
|
||||
|
@ -250,8 +250,8 @@ SparcTargetLowering::LowerReturn_64(SDValue Chain,
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Analyze return values.
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_Sparc64);
|
||||
|
@ -349,8 +349,8 @@ LowerFormalArguments_32(SDValue Chain,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeFormalArguments(Ins, CC_Sparc32);
|
||||
|
||||
const unsigned StackOffset = 92;
|
||||
|
@ -549,8 +549,8 @@ LowerFormalArguments_64(SDValue Chain,
|
|||
|
||||
// Analyze arguments according to CC_Sparc64.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeFormalArguments(Ins, CC_Sparc64);
|
||||
|
||||
// The argument array begins at %fp+BIAS+128, after the register save area.
|
||||
|
@ -698,8 +698,8 @@ SparcTargetLowering::LowerCall_32(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeCallOperands(Outs, CC_Sparc32);
|
||||
|
||||
// Get the size of the outgoing arguments stack space requirement.
|
||||
|
@ -934,8 +934,8 @@ SparcTargetLowering::LowerCall_32(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState RVInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs, *DAG.getContext());
|
||||
CCState RVInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
RVInfo.AnalyzeCallResult(Ins, RetCC_Sparc32);
|
||||
|
||||
|
@ -1061,8 +1061,8 @@ SparcTargetLowering::LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CLI.CallConv, CLI.IsVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CLI.CallConv, CLI.IsVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeCallOperands(CLI.Outs, CC_Sparc64);
|
||||
|
||||
// Get the size of the outgoing arguments stack space requirement.
|
||||
|
@ -1255,8 +1255,8 @@ SparcTargetLowering::LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState RVInfo(CLI.CallConv, CLI.IsVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs, *DAG.getContext());
|
||||
CCState RVInfo(CLI.CallConv, CLI.IsVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Set inreg flag manually for codegen generated library calls that
|
||||
// return float.
|
||||
|
|
|
@ -679,8 +679,7 @@ LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool IsVarArg,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, IsVarArg, MF, DAG.getTarget(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
CCState CCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.getContext());
|
||||
CCInfo.AnalyzeFormalArguments(Ins, CC_SystemZ);
|
||||
|
||||
unsigned NumFixedGPRs = 0;
|
||||
|
@ -818,8 +817,7 @@ SystemZTargetLowering::LowerCall(CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze the operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState ArgCCInfo(CallConv, IsVarArg, MF, DAG.getTarget(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
CCState ArgCCInfo(CallConv, IsVarArg, MF, ArgLocs, *DAG.getContext());
|
||||
ArgCCInfo.AnalyzeCallOperands(Outs, CC_SystemZ);
|
||||
|
||||
// We don't support GuaranteedTailCallOpt, only automatically-detected
|
||||
|
@ -942,8 +940,7 @@ SystemZTargetLowering::LowerCall(CallLoweringInfo &CLI,
|
|||
|
||||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RetLocs;
|
||||
CCState RetCCInfo(CallConv, IsVarArg, MF, DAG.getTarget(), RetLocs,
|
||||
*DAG.getContext());
|
||||
CCState RetCCInfo(CallConv, IsVarArg, MF, RetLocs, *DAG.getContext());
|
||||
RetCCInfo.AnalyzeCallResult(Ins, RetCC_SystemZ);
|
||||
|
||||
// Copy all of the result registers out of their specified physreg.
|
||||
|
@ -974,8 +971,7 @@ SystemZTargetLowering::LowerReturn(SDValue Chain,
|
|||
|
||||
// Assign locations to each returned value.
|
||||
SmallVector<CCValAssign, 16> RetLocs;
|
||||
CCState RetCCInfo(CallConv, IsVarArg, MF, DAG.getTarget(), RetLocs,
|
||||
*DAG.getContext());
|
||||
CCState RetCCInfo(CallConv, IsVarArg, MF, RetLocs, *DAG.getContext());
|
||||
RetCCInfo.AnalyzeReturn(Outs, RetCC_SystemZ);
|
||||
|
||||
// Quick exit for void returns
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
|
||||
/// CCIfSubtarget - Match if the current subtarget has a feature F.
|
||||
class CCIfSubtarget<string F, CCAction A>
|
||||
: CCIf<!strconcat("State.getTarget().getSubtarget<X86Subtarget>().", F), A>;
|
||||
: CCIf<!strconcat("static_cast<const X86Subtarget&>"
|
||||
"(State.getMachineFunction().getSubtarget()).", F),
|
||||
A>;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Return Value Calling Conventions
|
||||
|
|
|
@ -993,8 +993,7 @@ bool X86FastISel::X86SelectRet(const Instruction *I) {
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ValLocs;
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, TM, ValLocs,
|
||||
I->getContext());
|
||||
CCState CCInfo(CC, F.isVarArg(), *FuncInfo.MF, ValLocs, I->getContext());
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_X86);
|
||||
|
||||
const Value *RV = Ret->getOperand(0);
|
||||
|
@ -2730,8 +2729,7 @@ bool X86FastISel::FastLowerCall(CallLoweringInfo &CLI) {
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, TM, ArgLocs,
|
||||
CLI.RetTy->getContext());
|
||||
CCState CCInfo(CC, IsVarArg, *FuncInfo.MF, ArgLocs, CLI.RetTy->getContext());
|
||||
|
||||
// Allocate shadow area for Win64
|
||||
if (IsWin64)
|
||||
|
@ -2972,7 +2970,7 @@ bool X86FastISel::FastLowerCall(CallLoweringInfo &CLI) {
|
|||
|
||||
// Now handle call return values.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCRetInfo(CC, IsVarArg, *FuncInfo.MF, TM, RVLocs,
|
||||
CCState CCRetInfo(CC, IsVarArg, *FuncInfo.MF, RVLocs,
|
||||
CLI.RetTy->getContext());
|
||||
CCRetInfo.AnalyzeCallResult(Ins, RetCC_X86);
|
||||
|
||||
|
|
|
@ -1901,8 +1901,7 @@ X86TargetLowering::CanLowerReturn(CallingConv::ID CallConv,
|
|||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
LLVMContext &Context) const {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, MF.getTarget(),
|
||||
RVLocs, Context);
|
||||
CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
|
||||
return CCInfo.CheckReturn(Outs, RetCC_X86);
|
||||
}
|
||||
|
||||
|
@ -1921,8 +1920,7 @@ X86TargetLowering::LowerReturn(SDValue Chain,
|
|||
X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, DAG.getTarget(),
|
||||
RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, MF, RVLocs, *DAG.getContext());
|
||||
CCInfo.AnalyzeReturn(Outs, RetCC_X86);
|
||||
|
||||
SDValue Flag;
|
||||
|
@ -2092,8 +2090,8 @@ X86TargetLowering::LowerCallResult(SDValue Chain, SDValue InFlag,
|
|||
// Assign locations to each value returned by this call.
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
bool Is64Bit = Subtarget->is64Bit();
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeCallResult(Ins, RetCC_X86);
|
||||
|
||||
// Copy all of the result registers out of their specified physreg.
|
||||
|
@ -2289,8 +2287,7 @@ X86TargetLowering::LowerFormalArguments(SDValue Chain,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, DAG.getTarget(),
|
||||
ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, MF, ArgLocs, *DAG.getContext());
|
||||
|
||||
// Allocate shadow area for Win64
|
||||
if (IsWin64)
|
||||
|
@ -2656,8 +2653,7 @@ X86TargetLowering::LowerCall(TargetLowering::CallLoweringInfo &CLI,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, MF.getTarget(),
|
||||
ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, MF, ArgLocs, *DAG.getContext());
|
||||
|
||||
// Allocate shadow area for Win64
|
||||
if (IsWin64)
|
||||
|
@ -3253,8 +3249,8 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
return false;
|
||||
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
CCInfo.AnalyzeCallOperands(Outs, CC_X86);
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i)
|
||||
|
@ -3274,8 +3270,8 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
}
|
||||
if (Unused) {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CalleeCC, false, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CalleeCC, false, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
CCInfo.AnalyzeCallResult(Ins, RetCC_X86);
|
||||
for (unsigned i = 0, e = RVLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = RVLocs[i];
|
||||
|
@ -3288,13 +3284,13 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
// results are returned in the same way as what the caller expects.
|
||||
if (!CCMatch) {
|
||||
SmallVector<CCValAssign, 16> RVLocs1;
|
||||
CCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs1, *DAG.getContext());
|
||||
CCState CCInfo1(CalleeCC, false, DAG.getMachineFunction(), RVLocs1,
|
||||
*DAG.getContext());
|
||||
CCInfo1.AnalyzeCallResult(Ins, RetCC_X86);
|
||||
|
||||
SmallVector<CCValAssign, 16> RVLocs2;
|
||||
CCState CCInfo2(CallerCC, false, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), RVLocs2, *DAG.getContext());
|
||||
CCState CCInfo2(CallerCC, false, DAG.getMachineFunction(), RVLocs2,
|
||||
*DAG.getContext());
|
||||
CCInfo2.AnalyzeCallResult(Ins, RetCC_X86);
|
||||
|
||||
if (RVLocs1.size() != RVLocs2.size())
|
||||
|
@ -3320,8 +3316,8 @@ X86TargetLowering::IsEligibleForTailCallOptimization(SDValue Callee,
|
|||
// Check if stack adjustment is needed. For now, do not do this if any
|
||||
// argument is passed on the stack.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(),
|
||||
DAG.getTarget(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CalleeCC, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Allocate shadow area for Win64
|
||||
if (IsCalleeWin64)
|
||||
|
|
|
@ -1125,8 +1125,8 @@ XCoreTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
|
||||
// Analyze operands of the call, assigning locations to each operand.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// The ABI dictates there should be one stack slot available to the callee
|
||||
// on function entry (for saving lr).
|
||||
|
@ -1136,8 +1136,8 @@ XCoreTargetLowering::LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
|||
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
// Analyze return values to determine the number of bytes of stack required.
|
||||
CCState RetCCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState RetCCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
RetCCInfo.AllocateStack(CCInfo.getNextStackOffset(), 4);
|
||||
RetCCInfo.AnalyzeCallResult(Ins, RetCC_XCore);
|
||||
|
||||
|
@ -1291,8 +1291,8 @@ XCoreTargetLowering::LowerCCCArguments(SDValue Chain,
|
|||
|
||||
// Assign locations to all of the incoming arguments.
|
||||
SmallVector<CCValAssign, 16> ArgLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), ArgLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), ArgLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
CCInfo.AnalyzeFormalArguments(Ins, CC_XCore);
|
||||
|
||||
|
@ -1450,7 +1450,7 @@ CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
|
|||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||
LLVMContext &Context) const {
|
||||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
CCState CCInfo(CallConv, isVarArg, MF, getTargetMachine(), RVLocs, Context);
|
||||
CCState CCInfo(CallConv, isVarArg, MF, RVLocs, Context);
|
||||
if (!CCInfo.CheckReturn(Outs, RetCC_XCore))
|
||||
return false;
|
||||
if (CCInfo.getNextStackOffset() != 0 && isVarArg)
|
||||
|
@ -1474,8 +1474,8 @@ XCoreTargetLowering::LowerReturn(SDValue Chain,
|
|||
SmallVector<CCValAssign, 16> RVLocs;
|
||||
|
||||
// CCState - Info about the registers and stack slot.
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(),
|
||||
getTargetMachine(), RVLocs, *DAG.getContext());
|
||||
CCState CCInfo(CallConv, isVarArg, DAG.getMachineFunction(), RVLocs,
|
||||
*DAG.getContext());
|
||||
|
||||
// Analyze return values.
|
||||
if (!isVarArg)
|
||||
|
|
|
@ -179,14 +179,14 @@ void CallingConvEmitter::EmitAction(Record *Action,
|
|||
O << Size << ", ";
|
||||
else
|
||||
O << "\n" << IndentStr
|
||||
<< " State.getTarget().getSubtargetImpl()->getDataLayout()"
|
||||
<< " State.getMachineFunction().getSubtarget().getDataLayout()"
|
||||
"->getTypeAllocSize(EVT(LocVT).getTypeForEVT(State.getContext())),"
|
||||
" ";
|
||||
if (Align)
|
||||
O << Align;
|
||||
else
|
||||
O << "\n" << IndentStr
|
||||
<< " State.getTarget().getSubtargetImpl()->getDataLayout()"
|
||||
<< " State.getMachineFunction().getSubtarget().getDataLayout()"
|
||||
"->getABITypeAlignment(EVT(LocVT).getTypeForEVT(State.getContext()"
|
||||
"))";
|
||||
O << ");\n" << IndentStr
|
||||
|
|
Loading…
Reference in New Issue