35#define DEBUG_TYPE "mips-reg-info"
52 return &Mips::GPR32RegClass;
55 return &Mips::GPR64RegClass;
99 case Mips::INLINEASM: {
101 switch (
F.getMemoryConstraintID()) {
142 unsigned OpNo,
int FrameIndex,
144 int64_t SPOffset)
const {
160 MinCSFI = CSI[0].getFrameIdx();
161 MaxCSFI = CSI[CSI.size() - 1].getFrameIdx();
165 bool IsISRRegFI = MipsFI->
isISRRegFI(FrameIndex);
176 if ((FrameIndex >= MinCSFI && FrameIndex <= MaxCSFI) || EhDataRegFI ||
178 FrameReg =
ABI.GetStackPtr();
179 else if (
RegInfo->hasStackRealignment(MF)) {
181 FrameReg =
ABI.GetBasePtr();
185 FrameReg =
ABI.GetStackPtr();
199 Offset = SPOffset + (int64_t)StackSize;
200 Offset +=
MI.getOperand(OpNo + 1).getImm();
205 if (!
MI.isDebugValue()) {
209 unsigned OffsetBitSize =
212 if (OffsetBitSize < 16 && isInt<16>(
Offset) &&
219 ABI.ArePtrs64bit() ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;
232 }
else if (!isInt<16>(
Offset)) {
242 OffsetBitSize == 16 ? &NewImm :
nullptr);
247 Offset = SignExtend64<16>(NewImm);
252 MI.getOperand(OpNo).ChangeToRegister(FrameReg,
false,
false, IsKill);
253 MI.getOperand(OpNo + 1).ChangeToImmediate(
Offset);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const HexagonInstrInfo * TII
static unsigned getLoadStoreOffsetAlign(const unsigned Opcode)
Get the scale factor applied to the immediate in the given load/store.
static unsigned getLoadStoreOffsetSizeInBits(const unsigned Opcode, MachineOperand MO)
Get the size of the offset supported by the given load/store/inline asm.
uint64_t IntrinsicInst * II
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
bool isFixedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a fixed stack object.
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.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const TargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
const MachineBasicBlock * getParent() const
MachineOperand class - Representation of each machine instruction operand.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
MipsFunctionInfo - This class is derived from MachineFunction private Mips target-specific informatio...
bool isISRRegFI(int FI) const
bool isEhDataRegFI(int FI) const
Register getFrameRegister(const MachineFunction &MF) const override
Debug information queries.
const TargetRegisterClass * intRegClass(unsigned Size) const override
Return GPR register class.
bool requiresRegisterScavenging(const MachineFunction &MF) const override
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override
bool inMicroMipsMode() const
Wrapper class representing virtual and physical registers.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
virtual const TargetInstrInfo * getInstrInfo() const
@ Kill
The last use of a register.
Reg
All possible values of the reg field in the ModR/M byte.
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
bool isAligned(Align Lhs, uint64_t SizeInBytes)
Checks that SizeInBytes is a multiple of the alignment.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
bool isIntN(unsigned N, int64_t x)
Checks if an signed integer fits into the given (dynamic) bit width.
This struct is a compact representation of a valid (non-zero power of two) alignment.