38 #define DEBUG_TYPE "mips-reg-info" 40 #define GET_REGINFO_TARGET_DESC 41 #include "MipsGenRegisterInfo.inc" 49 unsigned Kind)
const {
53 switch (PtrClassKind) {
55 return ABI.
ArePtrs64bit() ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;
57 return &Mips::GPRMM16RegClass;
59 return ABI.
ArePtrs64bit() ? &Mips::SP64RegClass : &Mips::SP32RegClass;
61 return ABI.
ArePtrs64bit() ? &Mips::GP64RegClass : &Mips::GP32RegClass;
70 switch (RC->
getID()) {
73 case Mips::GPR32RegClassID:
74 case Mips::GPR64RegClassID:
75 case Mips::DSPRRegClassID: {
77 return 28 - TFI->
hasFP(MF);
79 case Mips::FGR32RegClassID:
81 case Mips::AFGR64RegClassID:
83 case Mips::FGR64RegClassID:
97 if (F.hasFnAttribute(
"interrupt")) {
99 return Subtarget.
hasMips64r6() ? CSR_Interrupt_64R6_SaveList
100 : CSR_Interrupt_64_SaveList;
102 return Subtarget.
hasMips32r6() ? CSR_Interrupt_32R6_SaveList
103 : CSR_Interrupt_32_SaveList;
107 return CSR_SingleFloatOnly_SaveList;
110 return CSR_N64_SaveList;
113 return CSR_N32_SaveList;
116 return CSR_O32_FP64_SaveList;
119 return CSR_O32_FPXX_SaveList;
121 return CSR_O32_SaveList;
129 return CSR_SingleFloatOnly_RegMask;
132 return CSR_N64_RegMask;
135 return CSR_N32_RegMask;
138 return CSR_O32_FP64_RegMask;
141 return CSR_O32_FPXX_RegMask;
143 return CSR_O32_RegMask;
147 return CSR_Mips16RetHelper_RegMask;
152 static const MCPhysReg ReservedGPR32[] = {
153 Mips::ZERO, Mips::K0, Mips::K1, Mips::SP
156 static const MCPhysReg ReservedGPR64[] = {
157 Mips::ZERO_64, Mips::K0_64, Mips::K1_64, Mips::SP_64
166 Reserved.
set(ReservedGPR32[
I]);
170 Reserved.
set(Mips::T6);
171 Reserved.
set(Mips::T7);
176 Reserved.
set(ReservedGPR64[I]);
180 Reserved.
set(Mips::GP);
181 Reserved.
set(Mips::GP_64);
186 for (RegIter
Reg = Mips::AFGR64RegClass.
begin(),
187 EReg = Mips::AFGR64RegClass.
end();
Reg != EReg; ++
Reg)
191 for (RegIter
Reg = Mips::FGR64RegClass.
begin(),
192 EReg = Mips::FGR64RegClass.
end();
Reg != EReg; ++
Reg)
198 Reserved.
set(Mips::S0);
201 Reserved.
set(Mips::FP_64);
206 if (needsStackRealignment(MF) &&
208 Reserved.
set(Mips::S7);
209 Reserved.
set(Mips::S7_64);
215 Reserved.
set(Mips::HWR29);
218 Reserved.
set(Mips::DSPPos);
219 Reserved.
set(Mips::DSPSCount);
220 Reserved.
set(Mips::DSPCarry);
221 Reserved.
set(Mips::DSPEFI);
222 Reserved.
set(Mips::DSPOutFlag);
225 Reserved.
set(Mips::MSAIR);
226 Reserved.
set(Mips::MSACSR);
227 Reserved.
set(Mips::MSAAccess);
228 Reserved.
set(Mips::MSASave);
229 Reserved.
set(Mips::MSAModify);
230 Reserved.
set(Mips::MSARequest);
231 Reserved.
set(Mips::MSAMap);
232 Reserved.
set(Mips::MSAUnmap);
238 Reserved.
set(Mips::RA_64);
239 Reserved.
set(Mips::T0);
242 Reserved.
set(Mips::S2);
247 Reserved.
set(Mips::GP);
248 Reserved.
set(Mips::GP_64);
252 for (
const auto &
Reg : Mips::OddSPRegClass)
279 errs() <<
"<--------->\n" 287 <<
"spOffset : " << spOffset <<
"\n" 288 <<
"stackSize : " << stackSize <<
"\n" 293 eliminateFI(MI, FIOperandNum, FrameIndex, stackSize, spOffset);
304 return TFI->hasFP(MF) ? Mips::S0 : Mips::SP;
306 return TFI->hasFP(MF) ? (IsN64 ? Mips::FP_64 :
Mips::FP) :
307 (IsN64 ? Mips::SP_64 : Mips::SP);
323 unsigned BP = Subtarget.
isGP32bit() ? Mips::S7 : Mips::S7_64;
const_iterator end(StringRef path)
Get end iterator over path.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
This class represents lattice values for constants.
bool inMips16Mode() const
The subset of registers permitted in certain microMIPS instructions such as lw16. ...
bool ArePtrs64bit() const
unsigned getFrameRegister(const MachineFunction &MF) const override
Debug information queries.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const override
SI optimize exec mask operations pre RA
virtual bool hasFP(const MachineFunction &MF) const =0
hasFP - Return true if the specified function should have a dedicated frame pointer register...
bool hasStandardEncoding() const
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
virtual bool canRealignStack(const MachineFunction &MF) const
True if the stack can be realigned for the target.
unsigned getID() const
Return the register class ID number.
BitVector getReservedRegs(const MachineFunction &MF) const override
bool canReserveReg(unsigned PhysReg) const
canReserveReg - Returns true if PhysReg can be used as a reserved register.
bool useSmallSection() const
bool isTargetNaCl() const
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
const TargetFrameLowering * getFrameLowering() const override
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
unsigned getObjectAlignment(int ObjectIdx) const
Return the alignment of the specified stack object.
friend const_iterator end(StringRef path)
Get end iterator over path.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind) const override
Code Generation virtual methods...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
The default register class for integer values.
bool isSingleFloat() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
virtual bool hasReservedCallFrame(const MachineFunction &MF) const
hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required, we reserve argument space for call sites in the function immediately on entry to the current function.
static unsigned getPICCallReg()
Get PIC indirect call register.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Mips Callee Saved Registers.
constexpr size_t array_lengthof(T(&)[N])
Find the length of an array.
Information about stack frame layout on the target.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
static const uint32_t * getMips16RetHelperMask()
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const override
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
virtual const TargetFrameLowering * getFrameLowering() const
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
bool requiresRegisterScavenging(const MachineFunction &MF) const override
const MCPhysReg * const_iterator
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
Stack Frame Processing Methods.
bool canRealignStack(const MachineFunction &MF) const override
const MachineOperand & getOperand(unsigned i) const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID) const override
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...