llvm.org GIT mirror llvm / 1e96bab
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 Duncan Sands 9 years ago
9 changed file(s) with 33 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
5656 LocInfo HTP : 6;
5757
5858 /// ValVT - The type of the value being assigned.
59 EVT ValVT;
59 MVT ValVT;
6060
6161 /// LocVT - The type of the location being assigned to.
6262 MVT LocVT;
6363 public:
6464
65 static CCValAssign getReg(unsigned ValNo, EVT ValVT,
65 static CCValAssign getReg(unsigned ValNo, MVT ValVT,
6666 unsigned RegNo, MVT LocVT,
6767 LocInfo HTP) {
6868 CCValAssign Ret;
7676 return Ret;
7777 }
7878
79 static CCValAssign getCustomReg(unsigned ValNo, EVT ValVT,
79 static CCValAssign getCustomReg(unsigned ValNo, MVT ValVT,
8080 unsigned RegNo, MVT LocVT,
8181 LocInfo HTP) {
8282 CCValAssign Ret;
8585 return Ret;
8686 }
8787
88 static CCValAssign getMem(unsigned ValNo, EVT ValVT,
88 static CCValAssign getMem(unsigned ValNo, MVT ValVT,
8989 unsigned Offset, MVT LocVT,
9090 LocInfo HTP) {
9191 CCValAssign Ret;
9999 return Ret;
100100 }
101101
102 static CCValAssign getCustomMem(unsigned ValNo, EVT ValVT,
102 static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT,
103103 unsigned Offset, MVT LocVT,
104104 LocInfo HTP) {
105105 CCValAssign Ret;
109109 }
110110
111111 unsigned getValNo() const { return ValNo; }
112 EVT getValVT() const { return ValVT; }
112 MVT getValVT() const { return ValVT; }
113113
114114 bool isRegLoc() const { return !isMem; }
115115 bool isMemLoc() const { return isMem; }
129129
130130 /// CCAssignFn - This function assigns a location for Val, updating State to
131131 /// reflect the change. It returns 'true' if it failed to handle Val.
132 typedef bool CCAssignFn(unsigned ValNo, EVT ValVT,
132 typedef bool CCAssignFn(unsigned ValNo, MVT ValVT,
133133 MVT LocVT, CCValAssign::LocInfo LocInfo,
134134 ISD::ArgFlagsTy ArgFlags, CCState &State);
135135
136136 /// CCCustomFn - This function assigns a location for Val, possibly updating
137137 /// all args to reflect changes and indicates if it handled it. It must set
138138 /// isCustom if it handles the arg and returns true.
139 typedef bool CCCustomFn(unsigned &ValNo, EVT &ValVT,
139 typedef bool CCCustomFn(unsigned &ValNo, MVT &ValVT,
140140 MVT &LocVT, CCValAssign::LocInfo &LocInfo,
141141 ISD::ArgFlagsTy &ArgFlags, CCState &State);
142142
283283 // HandleByVal - Allocate a stack slot large enough to pass an argument by
284284 // value. The size and alignment information of the argument is encoded in its
285285 // parameter attribute.
286 void HandleByVal(unsigned ValNo, EVT ValVT,
286 void HandleByVal(unsigned ValNo, MVT ValVT,
287287 MVT LocVT, CCValAssign::LocInfo LocInfo,
288288 int MinSize, int MinAlign, ISD::ArgFlagsTy ArgFlags);
289289
3333 // HandleByVal - Allocate a stack slot large enough to pass an argument by
3434 // value. The size and alignment information of the argument is encoded in its
3535 // parameter attribute.
36 void CCState::HandleByVal(unsigned ValNo, EVT ValVT,
36 void CCState::HandleByVal(unsigned ValNo, MVT ValVT,
3737 MVT LocVT, CCValAssign::LocInfo LocInfo,
3838 int MinSize, int MinAlign,
3939 ISD::ArgFlagsTy ArgFlags) {
2525 namespace llvm {
2626
2727 // APCS f64 is in register pairs, possibly split to stack
28 static bool f64AssignAPCS(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
28 static bool f64AssignAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
2929 CCValAssign::LocInfo &LocInfo,
3030 CCState &State, bool CanFail) {
3131 static const unsigned RegList[] = { ARM::R0, ARM::R1, ARM::R2, ARM::R3 };
5555 return true;
5656 }
5757
58 static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
58 static bool CC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
5959 CCValAssign::LocInfo &LocInfo,
6060 ISD::ArgFlagsTy &ArgFlags,
6161 CCState &State) {
6868 }
6969
7070 // AAPCS f64 is in aligned register pairs
71 static bool f64AssignAAPCS(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
71 static bool f64AssignAAPCS(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
7272 CCValAssign::LocInfo &LocInfo,
7373 CCState &State, bool CanFail) {
7474 static const unsigned HiRegList[] = { ARM::R0, ARM::R2 };
103103 return true;
104104 }
105105
106 static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
106 static bool CC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
107107 CCValAssign::LocInfo &LocInfo,
108108 ISD::ArgFlagsTy &ArgFlags,
109109 CCState &State) {
115115 return true; // we handled it
116116 }
117117
118 static bool f64RetAssign(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
118 static bool f64RetAssign(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
119119 CCValAssign::LocInfo &LocInfo, CCState &State) {
120120 static const unsigned HiRegList[] = { ARM::R0, ARM::R2 };
121121 static const unsigned LoRegList[] = { ARM::R1, ARM::R3 };
135135 return true;
136136 }
137137
138 static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
138 static bool RetCC_ARM_APCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
139139 CCValAssign::LocInfo &LocInfo,
140140 ISD::ArgFlagsTy &ArgFlags,
141141 CCState &State) {
146146 return true; // we handled it
147147 }
148148
149 static bool RetCC_ARM_AAPCS_Custom_f64(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
149 static bool RetCC_ARM_AAPCS_Custom_f64(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
150150 CCValAssign::LocInfo &LocInfo,
151151 ISD::ArgFlagsTy &ArgFlags,
152152 CCState &State) {
15661566 return false;
15671567 // TODO: For now, don't try to handle cases where getLocInfo()
15681568 // says Full but the types don't match.
1569 if (VA.getValVT() != TLI.getValueType(RV->getType()))
1569 if (TLI.getValueType(RV->getType()) != VA.getValVT())
15701570 return false;
15711571
15721572 // Make the copy.
467467
468468 #include "MBlazeGenCallingConv.inc"
469469
470 static bool CC_MBlaze2(unsigned ValNo, EVT ValVT,
470 static bool CC_MBlaze2(unsigned ValNo, MVT ValVT,
471471 MVT LocVT, CCValAssign::LocInfo LocInfo,
472472 ISD::ArgFlagsTy ArgFlags, CCState &State) {
473473 static const unsigned RegsSize=6;
552552 // Walk the register/memloc assignments, inserting copies/loads.
553553 for (unsigned i = 0, e = ArgLocs.size(); i != e; ++i) {
554554 CCValAssign &VA = ArgLocs[i];
555 EVT RegVT = VA.getLocVT();
555 MVT RegVT = VA.getLocVT();
556556 SDValue Arg = OutVals[i];
557557
558558 // Promote the value if needed.
719719
720720 // Arguments stored on registers
721721 if (VA.isRegLoc()) {
722 EVT RegVT = VA.getLocVT();
722 MVT RegVT = VA.getLocVT();
723723 ArgRegEnd = VA.getLocReg();
724724 TargetRegisterClass *RC = 0;
725725
628628 // go to stack.
629629 //===----------------------------------------------------------------------===//
630630
631 static bool CC_MipsO32(unsigned ValNo, EVT ValVT,
631 static bool CC_MipsO32(unsigned ValNo, MVT ValVT,
632632 MVT LocVT, CCValAssign::LocInfo LocInfo,
633633 ISD::ArgFlagsTy ArgFlags, CCState &State) {
634634
694694 return false; // CC must always match
695695 }
696696
697 static bool CC_MipsO32_VarArgs(unsigned ValNo, EVT ValVT,
697 static bool CC_MipsO32_VarArgs(unsigned ValNo, MVT ValVT,
698698 MVT LocVT, CCValAssign::LocInfo LocInfo,
699699 ISD::ArgFlagsTy ArgFlags, CCState &State) {
700700
788788 // To meet O32 ABI, Mips must always allocate 16 bytes on
789789 // the stack (even if less than 4 are used as arguments)
790790 if (Subtarget->isABI_O32()) {
791 int VTsize = EVT(MVT::i32).getSizeInBits()/8;
791 int VTsize = MVT(MVT::i32).getSizeInBits()/8;
792792 MFI->CreateFixedObject(VTsize, (VTsize*3), true);
793793 CCInfo.AnalyzeCallOperands(Outs,
794794 isVarArg ? CC_MipsO32_VarArgs : CC_MipsO32);
3737 #include "llvm/DerivedTypes.h"
3838 using namespace llvm;
3939
40 static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
40 static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
4141 CCValAssign::LocInfo &LocInfo,
4242 ISD::ArgFlagsTy &ArgFlags,
4343 CCState &State);
44 static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, EVT &ValVT,
44 static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, MVT &ValVT,
4545 MVT &LocVT,
4646 CCValAssign::LocInfo &LocInfo,
4747 ISD::ArgFlagsTy &ArgFlags,
4848 CCState &State);
49 static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, EVT &ValVT,
49 static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT,
5050 MVT &LocVT,
5151 CCValAssign::LocInfo &LocInfo,
5252 ISD::ArgFlagsTy &ArgFlags,
14421442
14431443 #include "PPCGenCallingConv.inc"
14441444
1445 static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, EVT &ValVT, MVT &LocVT,
1445 static bool CC_PPC_SVR4_Custom_Dummy(unsigned &ValNo, MVT &ValVT, MVT &LocVT,
14461446 CCValAssign::LocInfo &LocInfo,
14471447 ISD::ArgFlagsTy &ArgFlags,
14481448 CCState &State) {
14491449 return true;
14501450 }
14511451
1452 static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, EVT &ValVT,
1452 static bool CC_PPC_SVR4_Custom_AlignArgRegs(unsigned &ValNo, MVT &ValVT,
14531453 MVT &LocVT,
14541454 CCValAssign::LocInfo &LocInfo,
14551455 ISD::ArgFlagsTy &ArgFlags,
14761476 return false;
14771477 }
14781478
1479 static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, EVT &ValVT,
1479 static bool CC_PPC_SVR4_Custom_AlignFPArgRegs(unsigned &ValNo, MVT &ValVT,
14801480 MVT &LocVT,
14811481 CCValAssign::LocInfo &LocInfo,
14821482 ISD::ArgFlagsTy &ArgFlags,
710710 return false;
711711 // TODO: For now, don't try to handle cases where getLocInfo()
712712 // says Full but the types don't match.
713 if (VA.getValVT() != TLI.getValueType(RV->getType()))
713 if (TLI.getValueType(RV->getType()) != VA.getValVT())
714714 return false;
715715
716716 // The calling-convention tables for x87 returns don't tell
2525 // other.
2626 for (unsigned i = 0, e = CCs.size(); i != e; ++i) {
2727 O << "static bool " << CCs[i]->getName()
28 << "(unsigned ValNo, EVT ValVT,\n"
28 << "(unsigned ValNo, MVT ValVT,\n"
2929 << std::string(CCs[i]->getName().size()+13, ' ')
3030 << "MVT LocVT, CCValAssign::LocInfo LocInfo,\n"
3131 << std::string(CCs[i]->getName().size()+13, ' ')
4343 Counter = 0;
4444
4545 O << "\n\nstatic bool " << CC->getName()
46 << "(unsigned ValNo, EVT ValVT,\n"
46 << "(unsigned ValNo, MVT ValVT,\n"
4747 << std::string(CC->getName().size()+13, ' ')
4848 << "MVT LocVT, CCValAssign::LocInfo LocInfo,\n"
4949 << std::string(CC->getName().size()+13, ' ')