mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-28 14:10:41 +00:00
In the calling convention logic, ValVT is always a legal type,
and as such can be represented by an MVT - the more complicated EVT is not needed. Use MVT for ValVT everywhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118245 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
416941d50f
commit
1e96bab329
@ -57,13 +57,13 @@ private:
|
||||
LocInfo HTP : 6;
|
||||
|
||||
/// ValVT - The type of the value being assigned.
|
||||
EVT ValVT;
|
||||
MVT ValVT;
|
||||
|
||||
/// LocVT - The type of the location being assigned to.
|
||||
MVT LocVT;
|
||||
public:
|
||||
|
||||
static CCValAssign getReg(unsigned ValNo, EVT ValVT,
|
||||
static CCValAssign getReg(unsigned ValNo, MVT ValVT,
|
||||
unsigned RegNo, MVT LocVT,
|
||||
LocInfo HTP) {
|
||||
CCValAssign Ret;
|
||||
@ -77,7 +77,7 @@ public:
|
||||
return Ret;
|
||||
}
|
||||
|
||||
static CCValAssign getCustomReg(unsigned ValNo, EVT ValVT,
|
||||
static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT,
|
||||
unsigned RegNo, MVT LocVT,
|
||||
LocInfo HTP) {
|
||||
CCValAssign Ret;
|
||||
@ -86,7 +86,7 @@ public:
|
||||
return Ret;
|
||||
}
|
||||
|
||||
static CCValAssign getMem(unsigned ValNo, EVT ValVT,
|
||||
static CCValAssign getMem(unsigned ValNo, MVT ValVT,
|
||||
unsigned Offset, MVT LocVT,
|
||||
LocInfo HTP) {
|
||||
CCValAssign Ret;
|
||||
@ -100,7 +100,7 @@ public:
|
||||
return Ret;
|
||||
}
|
||||
|
||||
static CCValAssign getCustomMem(unsigned ValNo, EVT ValVT,
|
||||
static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT,
|
||||
unsigned Offset, MVT LocVT,
|
||||
LocInfo HTP) {
|
||||
CCValAssign Ret;
|
||||
@ -110,7 +110,7 @@ public:
|
||||
}
|
||||
|
||||
unsigned getValNo() const { return ValNo; }
|
||||
EVT getValVT() const { return ValVT; }
|
||||
MVT getValVT() const { return ValVT; }
|
||||
|
||||
bool isRegLoc() const { return !isMem; }
|
||||
bool isMemLoc() const { return isMem; }
|
||||
@ -130,14 +130,14 @@ public:
|
||||
|
||||
/// CCAssignFn - This function assigns a location for Val, updating State to
|
||||
/// reflect the change. It returns 'true' if it failed to handle Val.
|
||||
typedef bool CCAssignFn(unsigned ValNo, EVT ValVT,
|
||||
typedef bool CCAssignFn(unsigned ValNo, MVT ValVT,
|
||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||
ISD::ArgFlagsTy ArgFlags, CCState &State);
|
||||
|
||||
/// CCCustomFn - This function assigns a location for Val, possibly updating
|
||||
/// all args to reflect changes and indicates if it handled it. It must set
|
||||
/// isCustom if it handles the arg and returns true.
|
||||
typedef bool CCCustomFn(unsigned &ValNo, EVT &ValVT,
|
||||
typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
|
||||
MVT &LocVT, CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags, CCState &State);
|
||||
|
||||
@ -284,7 +284,7 @@ public:
|
||||
// HandleByVal - Allocate a stack slot large enough to pass an argument by
|
||||
// value. The size and alignment information of the argument is encoded in its
|
||||
// parameter attribute.
|
||||
void HandleByVal(unsigned ValNo, EVT ValVT,
|
||||
void HandleByVal(unsigned ValNo, MVT ValVT,
|
||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||
int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
|
||||
|
||||
|
@ -34,7 +34,7 @@ CCState::CCState(CallingConv::ID CC, bool isVarArg, const TargetMachine &tm,
|
||||
// HandleByVal - Allocate a stack slot large enough to pass an argument by
|
||||
// value. The size and alignment information of the argument is encoded in its
|
||||
// parameter attribute.
|
||||
void CCState::HandleByVal(unsigned ValNo, EVT ValVT,
|
||||
void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
|
||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||
int MinSize, int MinAlign,
|
||||
ISD::ArgFlagsTy ArgFlags) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
namespace llvm {
|
||||
|
||||
// APCS f64 is in register pairs, possibly split to stack
|
||||
static bool f64AssignAPCS(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool f64AssignAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
CCState &State, bool CanFail) {
|
||||
static const unsigned RegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
|
||||
@ -56,7 +56,7 @@ static bool f64AssignAPCS(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State) {
|
||||
@ -69,7 +69,7 @@ static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
}
|
||||
|
||||
// AAPCS f64 is in aligned register pairs
|
||||
static bool f64AssignAAPCS(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool f64AssignAAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
CCState &State, bool CanFail) {
|
||||
static const unsigned HiRegList[] = { ARM::R0, ARM::R2 };
|
||||
@ -104,7 +104,7 @@ static bool f64AssignAAPCS(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State) {
|
||||
@ -116,7 +116,7 @@ static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
return true; // we handled it
|
||||
}
|
||||
|
||||
static bool f64RetAssign(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool f64RetAssign(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo, CCState &State) {
|
||||
static const unsigned HiRegList[] = { ARM::R0, ARM::R2 };
|
||||
static const unsigned LoRegList[] = { ARM::R1, ARM::R3 };
|
||||
@ -136,7 +136,7 @@ static bool f64RetAssign(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State) {
|
||||
@ -147,7 +147,7 @@ static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
return true; // we handled it
|
||||
}
|
||||
|
||||
static bool RetCC_ARM_AAPCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool RetCC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State) {
|
||||
|
@ -1567,7 +1567,7 @@ bool ARMFastISel::SelectRet(const Instruction *I) {
|
||||
return false;
|
||||
// TODO: For now, don't try to handle cases where getLocInfo()
|
||||
// says Full but the types don't match.
|
||||
if (VA.getValVT() != TLI.getValueType(RV->getType()))
|
||||
if (TLI.getValueType(RV->getType()) != VA.getValVT())
|
||||
return false;
|
||||
|
||||
// Make the copy.
|
||||
|
@ -468,7 +468,7 @@ SDValue MBlazeTargetLowering::LowerVASTART(SDValue Op,
|
||||
|
||||
#include "MBlazeGenCallingConv.inc"
|
||||
|
||||
static bool CC_MBlaze2(unsigned ValNo, EVT ValVT,
|
||||
static bool CC_MBlaze2(unsigned ValNo, MVT ValVT,
|
||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
||||
static const unsigned RegsSize=6;
|
||||
@ -553,7 +553,7 @@ LowerCall(SDValue Chain, SDValue Callee, CallingConv::ID CallConv,
|
||||
// Walk the register/memloc assignments, inserting copies/loads.
|
||||
for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
|
||||
CCValAssign &VA = ArgLocs[i];
|
||||
EVT RegVT = VA.getLocVT();
|
||||
MVT RegVT = VA.getLocVT();
|
||||
SDValue Arg = OutVals[i];
|
||||
|
||||
// Promote the value if needed.
|
||||
@ -720,7 +720,7 @@ LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
|
||||
|
||||
// Arguments stored on registers
|
||||
if (VA.isRegLoc()) {
|
||||
EVT RegVT = VA.getLocVT();
|
||||
MVT RegVT = VA.getLocVT();
|
||||
ArgRegEnd = VA.getLocReg();
|
||||
TargetRegisterClass *RC = 0;
|
||||
|
||||
|
@ -629,7 +629,7 @@ SDValue MipsTargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG) const {
|
||||
// go to stack.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static bool CC_MipsO32(unsigned ValNo, EVT ValVT,
|
||||
static bool CC_MipsO32(unsigned ValNo, MVT ValVT,
|
||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
||||
|
||||
@ -695,7 +695,7 @@ static bool CC_MipsO32(unsigned ValNo, EVT ValVT,
|
||||
return false; // CC must always match
|
||||
}
|
||||
|
||||
static bool CC_MipsO32_VarArgs(unsigned ValNo, EVT ValVT,
|
||||
static bool CC_MipsO32_VarArgs(unsigned ValNo, MVT ValVT,
|
||||
MVT LocVT, CCValAssign::LocInfo LocInfo,
|
||||
ISD::ArgFlagsTy ArgFlags, CCState &State) {
|
||||
|
||||
@ -789,7 +789,7 @@ MipsTargetLowering::LowerCall(SDValue Chain, SDValue Callee,
|
||||
// To meet O32 ABI, Mips must always allocate 16 bytes on
|
||||
// the stack (even if less than 4 are used as arguments)
|
||||
if (Subtarget->isABI_O32()) {
|
||||
int VTsize = EVT(MVT::i32).getSizeInBits()/8;
|
||||
int VTsize = MVT(MVT::i32).getSizeInBits()/8;
|
||||
MFI->CreateFixedObject(VTsize, (VTsize*3), true);
|
||||
CCInfo.AnalyzeCallOperands(Outs,
|
||||
isVarArg ? CC_MipsO32_VarArgs : CC_MipsO32);
|
||||
|
@ -38,16 +38,16 @@
|
||||
#include "llvm/DerivedTypes.h"
|
||||
using namespace llvm;
|
||||
|
||||
static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State);
|
||||
static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, EVT &ValVT,
|
||||
static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||
MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State);
|
||||
static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, EVT &ValVT,
|
||||
static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||
MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
@ -1443,14 +1443,14 @@ SDValue PPCTargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG,
|
||||
|
||||
#include "PPCGenCallingConv.inc"
|
||||
|
||||
static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
|
||||
static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
CCState &State) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, EVT &ValVT,
|
||||
static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||
MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
@ -1477,7 +1477,7 @@ static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, EVT &ValVT,
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, EVT &ValVT,
|
||||
static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT,
|
||||
MVT &LocVT,
|
||||
CCValAssign::LocInfo &LocInfo,
|
||||
ISD::ArgFlagsTy &ArgFlags,
|
||||
|
@ -711,7 +711,7 @@ bool X86FastISel::X86SelectRet(const Instruction *I) {
|
||||
return false;
|
||||
// TODO: For now, don't try to handle cases where getLocInfo()
|
||||
// says Full but the types don't match.
|
||||
if (VA.getValVT() != TLI.getValueType(RV->getType()))
|
||||
if (TLI.getValueType(RV->getType()) != VA.getValVT())
|
||||
return false;
|
||||
|
||||
// The calling-convention tables for x87 returns don't tell
|
||||
|
@ -26,7 +26,7 @@ void CallingConvEmitter::run(raw_ostream &O) {
|
||||
// other.
|
||||
for (unsigned i = 0, e = CCs.size(); i != e; ++i) {
|
||||
O << "static bool " << CCs[i]->getName()
|
||||
<< "(unsigned ValNo, EVT ValVT,\n"
|
||||
<< "(unsigned ValNo, MVT ValVT,\n"
|
||||
<< std::string(CCs[i]->getName().size()+13, ' ')
|
||||
<< "MVT LocVT, CCValAssign::LocInfo LocInfo,\n"
|
||||
<< std::string(CCs[i]->getName().size()+13, ' ')
|
||||
@ -44,7 +44,7 @@ void CallingConvEmitter::EmitCallingConv(Record *CC, raw_ostream &O) {
|
||||
Counter = 0;
|
||||
|
||||
O << "\n\nstatic bool " << CC->getName()
|
||||
<< "(unsigned ValNo, EVT ValVT,\n"
|
||||
<< "(unsigned ValNo, MVT ValVT,\n"
|
||||
<< std::string(CC->getName().size()+13, ' ')
|
||||
<< "MVT LocVT, CCValAssign::LocInfo LocInfo,\n"
|
||||
<< std::string(CC->getName().size()+13, ' ')
|
||||
|
Loading…
Reference in New Issue
Block a user