Index: src/IceTargetLoweringMIPS32.h |
diff --git a/src/IceTargetLoweringMIPS32.h b/src/IceTargetLoweringMIPS32.h |
index 3366dcea677cec844f82fdebbc75e05d8250ee9f..cfbaa6f2d4b5f56af050441e23b2bfdf2105499d 100644 |
--- a/src/IceTargetLoweringMIPS32.h |
+++ b/src/IceTargetLoweringMIPS32.h |
@@ -447,6 +447,11 @@ public: |
static Type stackSlotType(); |
Variable *copyToReg(Operand *Src, RegNumT RegNum = RegNumT()); |
+ // Iterates over the CFG and determines the maximum outgoing stack arguments |
+ // bytes. This information is later used during addProlog() to pre-allocate |
+ // the outargs area |
+ void findMaxStackOutArgsSize(); |
+ |
void addProlog(CfgNode *Node) override; |
void addEpilog(CfgNode *Node) override; |
@@ -457,8 +462,48 @@ public: |
Operand *loOperand(Operand *Operand); |
Operand *hiOperand(Operand *Operand); |
+ void finishArgumentLowering(Variable *Arg, Variable *FramePtr, |
+ size_t BasicFrameOffset, size_t *InArgsSizeBytes); |
+ |
Operand *legalizeUndef(Operand *From, RegNumT RegNum = RegNumT()); |
+ /// Helper class that understands the Calling Convention and register |
+ /// assignments as per MIPS O32 abi. |
+ class CallingConv { |
+ CallingConv(const CallingConv &) = delete; |
+ CallingConv &operator=(const CallingConv &) = delete; |
+ |
+ public: |
+ CallingConv(); |
+ ~CallingConv() = default; |
+ |
+ /// argInReg returns true if there is a Register available for the requested |
+ /// type, and false otherwise. If it returns true, Reg is set to the |
+ /// appropriate register number. Note that, when Ty == IceType_i64, Reg will |
+ /// be an I64 register pair. |
+ bool argInReg(Type Ty, uint32_t ArgNo, RegNumT *Reg); |
+ |
+ private: |
+ // argInGPR is used to find if any GPR register is available for argument of |
+ // type Ty |
+ bool argInGPR(Type Ty, RegNumT *Reg); |
+ /// argInVFP is to floating-point/vector types what argInGPR is for integer |
+ /// types. |
+ bool argInVFP(Type Ty, RegNumT *Reg); |
+ inline void discardNextGPRAndItsAliases(CfgVector<RegNumT> *Regs); |
+ void discardUnavailableGPRsAndTheirAliases(CfgVector<RegNumT> *Regs); |
+ SmallBitVector GPRegsUsed; |
+ CfgVector<RegNumT> GPRArgs; |
+ CfgVector<RegNumT> I64Args; |
+ |
+ void discardUnavailableVFPRegsAndTheirAliases(CfgVector<RegNumT> *Regs); |
+ SmallBitVector VFPRegsUsed; |
+ CfgVector<RegNumT> FP32Args; |
+ CfgVector<RegNumT> FP64Args; |
+ // UseFPRegs is a flag indicating if FP registers can be used |
+ bool UseFPRegs = false; |
+ }; |
+ |
protected: |
explicit TargetMIPS32(Cfg *Func); |
@@ -506,13 +551,18 @@ protected: |
bool UsesFramePointer = false; |
bool NeedsStackAlignment = false; |
+ bool MaybeLeafFunc = true; |
+ bool PrologEmitsFixedAllocas = false; |
+ uint32_t MaxOutArgsSizeBytes = 0; |
static SmallBitVector TypeToRegisterSet[RCMIPS32_NUM]; |
static SmallBitVector TypeToRegisterSetUnfiltered[RCMIPS32_NUM]; |
static SmallBitVector RegisterAliases[RegMIPS32::Reg_NUM]; |
SmallBitVector RegsUsed; |
VarList PhysicalRegisters[IceType_NUM]; |
+ VarList PreservedGPRs; |
static constexpr uint32_t CHAR_BITS = 8; |
static constexpr uint32_t INT32_BITS = 32; |
+ size_t SpillAreaSizeBytes = 0; |
private: |
ENABLE_MAKE_UNIQUE; |