39 #define DEBUG_TYPE "mips-reg-info" 56 return &Mips::GPR32RegClass;
59 return &Mips::GPR64RegClass;
105 switch (ConstraintID) {
148 int64_t SPOffset)
const {
164 MinCSFI = CSI[0].getFrameIdx();
165 MaxCSFI = CSI[CSI.size() - 1].getFrameIdx();
182 FrameReg = ABI.GetStackPtr();
183 else if (RegInfo->needsStackRealignment(MF)) {
185 FrameReg = ABI.GetBasePtr();
189 FrameReg = ABI.GetStackPtr();
203 Offset = SPOffset + (int64_t)StackSize;
213 unsigned OffsetBitSize =
216 if (OffsetBitSize < 16 &&
isInt<16>(Offset) &&
223 ABI.ArePtrs64bit() ? &Mips::GPR64RegClass : &Mips::GPR32RegClass;
229 BuildMI(MBB, II, DL, TII.get(ABI.GetPtrAddiuOp()), Reg)
246 OffsetBitSize == 16 ? &NewImm :
nullptr);
247 BuildMI(MBB, II, DL, TII.get(ABI.GetPtrAdduOp()), Reg).
addReg(FrameReg)
251 Offset = SignExtend64<16>(NewImm);
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
This class represents lattice values for constants.
Register createVirtualRegister(const TargetRegisterClass *RegClass, StringRef Name="")
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Register getFrameRegister(const MachineFunction &MF) const override
Debug information queries.
constexpr bool isInt< 16 >(int64_t x)
const HexagonInstrInfo * TII
bool inMicroMipsMode() const
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 ...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
INLINEASM - Represents an inline asm block.
virtual const TargetInstrInfo * getInstrInfo() const
bool requiresRegisterScavenging(const MachineFunction &MF) const override
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
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.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isFixedObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a fixed stack object.
static unsigned getMemoryConstraintID(unsigned Flag)
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
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.
bool isDebugValue() const
MachineOperand class - Representation of each machine instruction operand.
const TargetRegisterClass * intRegClass(unsigned Size) const override
Return GPR register class.
CHAIN = SC CHAIN, Imm128 - System call.
bool isAligned(Align Lhs, uint64_t SizeInBytes)
Checks that SizeInBytes is a multiple of the alignment.
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
void ChangeToRegister(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value...
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
unsigned loadImmediate(int64_t Imm, MachineBasicBlock &MBB, MachineBasicBlock::iterator II, const DebugLoc &DL, unsigned *NewImm) const
Emit a series of instructions to load an immediate.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isEhDataRegFI(int FI) const
const MachineOperand & getOperand(unsigned i) const
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
static unsigned getLoadStoreOffsetAlign(const unsigned Opcode)
Get the scale factor applied to the immediate in the given load/store.
Wrapper class representing virtual and physical registers.
bool isISRRegFI(int FI) const
static unsigned getLoadStoreOffsetSizeInBits(const unsigned Opcode, MachineOperand MO)
Get the size of the offset supported by the given load/store/inline asm.
bool requiresFrameIndexScavenging(const MachineFunction &MF) const override