60 if (CFSize >= ((1 << 8) - 1) * 4 / 2)
71 unsigned ScratchReg,
unsigned MIFlags) {
79 if (ScratchReg == ARM::NoRegister)
84 BuildMI(MBB, MBBI, dl, TII.
get(ARM::t2MOVi32imm), ScratchReg)
90 BuildMI(MBB, MBBI, dl, TII.
get(ARM::tADDhirr), ARM::SP)
125 unsigned Amount = TII.getFrameSize(Old);
134 if (Opc == ARM::ADJCALLSTACKDOWN || Opc == ARM::tADJCALLSTACKDOWN) {
137 assert(Opc == ARM::ADJCALLSTACKUP || Opc == ARM::tADJCALLSTACKUP);
159 assert(NumBytes >= ArgRegsSaveSize &&
160 "ArgRegsSaveSize is included in NumBytes");
172 NumBytes = (NumBytes + 3) & ~3;
177 unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0;
178 int FramePtrSpillFI = 0;
180 if (ArgRegsSaveSize) {
183 CFAOffset -= ArgRegsSaveSize;
186 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
187 .addCFIIndex(CFIIndex)
192 if (NumBytes - ArgRegsSaveSize != 0) {
194 -(NumBytes - ArgRegsSaveSize),
196 CFAOffset -= NumBytes - ArgRegsSaveSize;
199 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
200 .addCFIIndex(CFIIndex)
206 for (
unsigned i = 0,
e = CSI.size(); i !=
e; ++i) {
207 unsigned Reg = CSI[i].getReg();
208 int FI = CSI[i].getFrameIdx();
225 FramePtrSpillFI = FI;
233 if (MBBI != MBB.
end() && MBBI->getOpcode() == ARM::tPUSH) {
238 unsigned DPRCSOffset = NumBytes - ArgRegsSaveSize - (GPRCS1Size + GPRCS2Size + DPRCSSize);
239 unsigned GPRCS2Offset = DPRCSOffset + DPRCSSize;
240 unsigned GPRCS1Offset = GPRCS2Offset + GPRCS2Size;
241 bool HasFP =
hasFP(MF);
248 NumBytes = DPRCSOffset;
250 int FramePtrOffsetInBlock = 0;
251 unsigned adjustedGPRCS1Size = GPRCS1Size;
252 if (GPRCS1Size > 0 && GPRCS2Size == 0 &&
254 FramePtrOffsetInBlock = NumBytes;
255 adjustedGPRCS1Size += NumBytes;
259 if (adjustedGPRCS1Size) {
260 CFAOffset -= adjustedGPRCS1Size;
263 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
264 .addCFIIndex(CFIIndex)
267 for (std::vector<CalleeSavedInfo>::const_iterator
I = CSI.begin(),
268 E = CSI.end();
I !=
E; ++
I) {
269 unsigned Reg =
I->getReg();
270 int FI =
I->getFrameIdx();
291 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
292 .addCFIIndex(CFIIndex)
300 FramePtrOffsetInBlock +=
304 .
addImm(FramePtrOffsetInBlock / 4)
307 if(FramePtrOffsetInBlock) {
308 CFAOffset += FramePtrOffsetInBlock;
311 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
312 .addCFIIndex(CFIIndex)
318 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
319 .addCFIIndex(CFIIndex)
335 while (MBBI != MBB.
end() && MBBI->getOpcode() == ARM::tMOVr)
337 if (MBBI != MBB.
end() && MBBI->getOpcode() == ARM::tPUSH) {
349 for (
auto &
I : CSI) {
350 unsigned Reg =
I.getReg();
351 int FI =
I.getFrameIdx();
360 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
361 .addCFIIndex(CFIIndex)
376 unsigned ScratchRegister = ARM::NoRegister;
377 for (
auto &
I : CSI) {
378 unsigned Reg =
I.getReg();
380 ScratchRegister =
Reg;
387 CFAOffset -= NumBytes;
390 BuildMI(MBB, MBBI, dl, TII.get(TargetOpcode::CFI_INSTRUCTION))
391 .addCFIIndex(CFIIndex)
404 if (RegInfo->needsStackRealignment(MF)) {
428 BuildMI(MBB, MBBI, dl, TII.get(ARM::tMOVr), ARM::SP)
440 BuildMI(MBB, MBBI, dl, TII.get(ARM::tMOVr), BasePtr)
461 }
else if (MI.
getOpcode() == ARM::tMOVr) {
464 return ((ARM::tGPRRegClass.
contains(Src) || Src == ARM::LR) &&
483 assert((
unsigned)NumBytes >= ArgRegsSaveSize &&
484 "ArgRegsSaveSize is included in NumBytes");
485 const MCPhysReg *CSRegs = RegInfo->getCalleeSavedRegs(&MF);
489 if (NumBytes - ArgRegsSaveSize != 0)
491 NumBytes - ArgRegsSaveSize, ARM::NoRegister,
495 if (MBBI != MBB.
begin()) {
516 "No scratch register to restore SP from FP!");
519 BuildMI(MBB, MBBI, dl, TII.get(ARM::tMOVr), ARM::SP)
523 BuildMI(MBB, MBBI, dl, TII.get(ARM::tMOVr), ARM::SP)
530 unsigned ScratchRegister = ARM::NoRegister;
531 bool HasFP =
hasFP(MF);
533 unsigned Reg =
I.getReg();
535 ScratchRegister =
Reg;
539 if (MBBI != MBB.
end() && MBBI->getOpcode() == ARM::tBX_RET &&
540 &MBB.
front() != &*MBBI && std::prev(MBBI)->getOpcode() == ARM::tPOP) {
551 if (needPopSpecialFixUp(MF)) {
552 bool Done = emitPopSpecialFixUp(MBB,
true);
554 assert(Done &&
"Emission of the special fixup failed!?");
559 if (!needPopSpecialFixUp(*MBB.
getParent()))
563 return emitPopSpecialFixUp(*TmpMBB,
false);
566 bool Thumb1FrameLowering::needPopSpecialFixUp(
const MachineFunction &MF)
const {
574 if (CSI.getReg() == ARM::LR)
617 bool CanRestoreDirectly =
STI.
hasV5TOps() && !ArgRegsSaveSize;
618 if (CanRestoreDirectly) {
619 if (MBBI != MBB.
end() && MBBI->getOpcode() != ARM::tB)
620 CanRestoreDirectly = (MBBI->getOpcode() == ARM::tBX_RET ||
621 MBBI->getOpcode() == ARM::tPOP_RET);
623 auto MBBI_prev = MBBI;
625 assert(MBBI_prev->getOpcode() == ARM::tPOP);
630 CanRestoreDirectly =
false;
634 if (CanRestoreDirectly) {
635 if (!DoIt || MBBI->getOpcode() == ARM::tPOP_RET)
638 BuildMI(MBB, MBBI, MBBI->getDebugLoc(), TII.
get(ARM::tPOP_RET))
641 for (
auto MO: MBBI->operands())
642 if (MO.isReg() && (MO.isImplicit() || MO.isDef()))
660 for (
unsigned i = 0; CSRegs[i]; ++i)
661 UsedRegs.
addReg(CSRegs[i]);
664 if (MBBI != MBB.
end()) {
665 dl = MBBI->getDebugLoc();
666 auto InstUpToMBBI = MBB.
end();
667 while (InstUpToMBBI != MBBI)
676 unsigned TemporaryReg = 0;
683 PopFriendly.
set(ARM::R7);
685 assert(PopFriendly.
any() &&
"No allocatable pop-friendly register?!");
690 GPRsNoLRSP |= PopFriendly;
691 GPRsNoLRSP.
reset(ARM::LR);
692 GPRsNoLRSP.
reset(ARM::SP);
693 GPRsNoLRSP.
reset(ARM::PC);
699 bool UseLDRSP =
false;
700 if (!PopReg && MBBI != MBB.
begin()) {
701 auto PrevMBBI = MBBI;
703 if (PrevMBBI->getOpcode() == ARM::tPOP) {
713 if (!DoIt && !PopReg && !TemporaryReg)
716 assert((PopReg || TemporaryReg) &&
"Cannot get LR");
719 assert(PopReg &&
"Do not know how to get LR");
724 .
addImm(MBBI->getNumExplicitOperands() - 2)
735 ArgRegsSaveSize + 4, ARM::NoRegister,
741 assert(!PopReg &&
"Unnecessary MOV is about to be inserted");
749 if (MBBI != MBB.
end() && MBBI->getOpcode() == ARM::tPOP_RET) {
753 BuildMI(MBB, MBBI, MBBI->getDebugLoc(), TII.
get(ARM::tPOP))
756 for (
auto MO: MBBI->operands())
757 if (MO.isReg() && (MO.isImplicit() || MO.isDef()) &&
758 MO.getReg() != ARM::PC) {
760 if (!MO.isImplicit())
772 assert(PopReg &&
"Do not know how to get LR");
801 const unsigned *OrderEnd) {
802 while (CurrentReg != OrderEnd && !EnabledRegs[*CurrentReg])
810 const std::vector<CalleeSavedInfo> &CSI,
826 for (
unsigned i = CSI.size(); i != 0; --i) {
827 unsigned Reg = CSI[i-1].getReg();
829 if (ARM::tGPRRegClass.
contains(Reg) || Reg == ARM::LR) {
830 LoRegsToSave[
Reg] =
true;
831 }
else if (ARM::hGPRRegClass.
contains(Reg) && Reg != ARM::LR) {
832 HiRegsToSave[
Reg] =
true;
837 if ((ARM::tGPRRegClass.
contains(Reg) || Reg == ARM::LR) &&
840 CopyRegs[
Reg] =
true;
844 for (
unsigned ArgReg : {ARM::R0, ARM::R1,
ARM::R2, ARM::R3})
846 CopyRegs[ArgReg] =
true;
850 if (!LoRegsToSave.none()) {
854 if (LoRegsToSave[
Reg]) {
874 static const unsigned AllCopyRegs[] = {ARM::LR, ARM::R7,
ARM::R6,
877 static const unsigned AllHighRegs[] = {ARM::R11, ARM::R10, ARM::R9, ARM::R8};
879 const unsigned *AllCopyRegsEnd =
std::end(AllCopyRegs);
880 const unsigned *AllHighRegsEnd =
std::end(AllHighRegs);
884 std::begin(AllHighRegs), HiRegsToSave, AllHighRegsEnd);
886 while (HiRegToSave != AllHighRegsEnd) {
888 const unsigned *CopyReg =
897 while (HiRegToSave != AllHighRegsEnd && CopyReg != AllCopyRegsEnd) {
898 if (HiRegsToSave[*HiRegToSave]) {
899 bool isKill = !MRI.
isLiveIn(*HiRegToSave);
933 std::vector<CalleeSavedInfo> &CSI,
953 unsigned Reg =
I.getReg();
955 if (ARM::tGPRRegClass.
contains(Reg) || Reg == ARM::LR) {
956 LoRegsToRestore[
Reg] =
true;
957 }
else if (ARM::hGPRRegClass.
contains(Reg) && Reg != ARM::LR) {
958 HiRegsToRestore[
Reg] =
true;
965 if ((ARM::tGPRRegClass.
contains(Reg)) &&
967 CopyRegs[
Reg] =
true;
974 CopyRegs[ARM::R0] =
true;
975 CopyRegs[ARM::R1] =
true;
977 CopyRegs[ARM::R3] =
true;
980 CopyRegs[
Op.getReg()] =
false;
984 static const unsigned AllCopyRegs[] = {ARM::R0, ARM::R1,
ARM::R2, ARM::R3,
986 static const unsigned AllHighRegs[] = {ARM::R8, ARM::R9, ARM::R10, ARM::R11};
988 const unsigned *AllCopyRegsEnd =
std::end(AllCopyRegs);
989 const unsigned *AllHighRegsEnd =
std::end(AllHighRegs);
993 HiRegsToRestore, AllHighRegsEnd);
995 while (HiRegToRestore != AllHighRegsEnd) {
1005 while (HiRegToRestore != AllHighRegsEnd && CopyReg != AllCopyRegsEnd) {
1024 bool NeedsPop =
false;
1025 for (
unsigned i = CSI.size(); i != 0; --i) {
1030 if (!(ARM::tGPRRegClass.
contains(Reg) || Reg == ARM::LR))
1033 if (Reg == ARM::LR) {
1036 MI->getOpcode() == ARM::TCRETURNdi ||
1037 MI->getOpcode() == ARM::TCRETURNri)
1054 (*MIB).setDesc(TII.get(ARM::tPOP_RET));
1055 if (MI != MBB.
end())
BitVector getAllocatableSet(const MachineFunction &MF, const TargetRegisterClass *RC=nullptr) const
Returns a bitset indexed by register number indicating if a register is allocatable or not...
const MachineInstrBuilder & add(const MachineOperand &MO) const
const_iterator end(StringRef path)
Get end iterator over path.
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
DILocation * get() const
Get the underlying DILocation.
bool isReserved(Register PhysReg) const
isReserved - Returns true when PhysReg is a reserved register.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
MachineFunctionProperties & reset(Property P)
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
const MachineFunctionProperties & getProperties() const
Get the function properties.
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
void push_back(const T &Elt)
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
LLVM_NODISCARD unsigned addFrameInst(const MCCFIInstruction &Inst)
iterator getFirstTerminator()
Returns an iterator to the first terminator instruction of this basic block.
static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register, int Offset)
.cfi_offset Previous value of Register is saved at offset Offset from CFA.
Register getFrameRegister(const MachineFunction &MF) const override
bool test(unsigned Idx) const
static void emitCallSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const TargetInstrInfo &TII, const DebugLoc &dl, const ThumbRegisterInfo &MRI, int NumBytes, unsigned MIFlags=MachineInstr::NoFlags)
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
unsigned const TargetRegisterInfo * TRI
MachineModuleInfo & getMMI() const
bool contains(MCPhysReg Reg) const
Returns true if register Reg is contained in the set.
bool tryFoldSPUpdateIntoPushPop(const ARMSubtarget &Subtarget, MachineFunction &MF, MachineInstr *MI, unsigned NumBytes)
Tries to add registers to the reglist of a given base-updating push/pop instruction to adjust the sta...
void setGPRCalleeSavedArea2Offset(unsigned o)
static MCCFIInstruction createDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA.
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
const TargetRegisterClass * getRegClass(unsigned i) const
Returns the register class associated with the enumeration value.
return AArch64::GPR64RegClass contains(Reg)
bool genExecuteOnly() const
const ARMBaseInstrInfo * getInstrInfo() const override
unsigned countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
const HexagonInstrInfo * TII
int find_first() const
find_first - Returns the index of the first set bit, -1 if none of the bits are set.
Thumb1FrameLowering(const ARMSubtarget &sti)
MachineBasicBlock iterator that automatically skips over MIs that are inside bundles (i...
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
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.
void setDPRCalleeSavedAreaOffset(unsigned o)
unsigned getArgRegsSaveSize() const
void setFramePtrSpillOffset(unsigned o)
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
int getDwarfRegNum(MCRegister RegNum, bool isEH) const
Map a target register to an equivalent dwarf register number.
static std::array< MachineOperand, 2 > predOps(ARMCC::CondCodes Pred, unsigned PredReg=0)
Get the operands corresponding to the given Pred value.
unsigned getDPRCalleeSavedAreaSize() const
bool splitFramePushPop(const MachineFunction &MF) const
Returns true if the frame setup is split into two separate pushes (first r0-r7,lr then r8-r11)...
void setShouldRestoreSPFromFP(bool s)
bool shouldRestoreSPFromFP() const
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
virtual const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const =0
Return a null-terminated list of all of the callee-saved registers on this target.
Analysis containing CSE Info
bool useR7AsFramePointer() const
unsigned getKillRegState(bool B)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
TargetInstrInfo - Interface to description of machine instruction set.
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
unsigned getDefRegState(bool B)
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static bool isCalleeSavedRegister(unsigned Reg, const MCPhysReg *CSRegs)
unsigned const MachineRegisterInfo * MRI
static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register)
.cfi_def_cfa_register modifies a rule for computing CFA.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void setStackSize(uint64_t Size)
Set the size of the stack.
void addLiveOuts(const MachineBasicBlock &MBB)
Adds all live-out registers of basic block MBB.
bool any() const
any - Returns true if any bit is set.
unsigned getGPRCalleeSavedArea1Size() const
bool canUseAsEpilogue(const MachineBasicBlock &MBB) const override
Check whether or not the given MBB can be used as a epilogue for the target.
void stepBackward(const MachineInstr &MI)
Simulates liveness when stepping backwards over an instruction(bundle).
unsigned getMaxAlignment() const
Return the alignment in bytes that this function must be aligned to, which is greater than the defaul...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
bool hasBasePointer(const MachineFunction &MF) const
void setGPRCalleeSavedArea2Size(unsigned s)
bool hasReservedCallFrame(const MachineFunction &MF) const override
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.
succ_iterator succ_begin()
void DeleteMachineInstr(MachineInstr *MI)
DeleteMachineInstr - Delete the given MachineInstr.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This file implements the LivePhysRegs utility for tracking liveness of physical registers.
unsigned getStackAlignment() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void emitLoadConstPool(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, unsigned DestReg, unsigned SubIdx, int Val, ARMCC::CondCodes Pred=ARMCC::AL, unsigned PredReg=0, unsigned MIFlags=MachineInstr::NoFlags) const override
emitLoadConstPool - Emits a load from constpool to materialize the specified immediate.
void setGPRCalleeSavedArea1Size(unsigned s)
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
unsigned getMaxCallFrameSize() const
Return the maximum size of a call frame that must be allocated for an outgoing function call...
static uint64_t add(uint64_t LeftOp, uint64_t RightOp)
static bool isCSRestore(MachineInstr &MI, const MCPhysReg *CSRegs)
void setOffsetAdjustment(int Adj)
Set the correction for frame offsets.
MachineInstr * getInstr() const
If conversion operators fail, use this method to get the MachineInstr explicitly. ...
unsigned getBaseRegister() const
The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...
std::bitset< ARM::NUM_TARGET_REGS > ARMRegSet
const MachineInstrBuilder & copyImplicitOps(const MachineInstr &OtherMI) const
Copy all the implicit operands from OtherMI onto this one.
unsigned succ_size() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
bool isLiveIn(unsigned Reg) const
static bool isARMLowRegister(unsigned Reg)
isARMLowRegister - Returns true if the register is a low register (r0-r7).
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
unsigned getGPRCalleeSavedArea2Size() const
void setGPRCalleeSavedArea1Offset(unsigned o)
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
A set of physical registers with utility functions to track liveness when walking backward/forward th...
const MachineInstrBuilder & setMIFlags(unsigned Flags) const
const std::vector< CalleeSavedInfo > & getCalleeSavedInfo() const
Returns a reference to call saved info vector for the current function.
ARMFunctionInfo - This class is derived from MachineFunctionInfo and contains private ARM-specific in...
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
APFloat abs(APFloat X)
Returns the absolute value of the argument.
const ARMBaseRegisterInfo * getRegisterInfo() const override
static const unsigned * findNextOrderedReg(const unsigned *CurrentReg, const ARMRegSet &EnabledRegs, const unsigned *OrderEnd)
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
void emitThumbRegPlusImmediate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const DebugLoc &dl, unsigned DestReg, unsigned BaseReg, int NumBytes, const TargetInstrInfo &TII, const ARMBaseRegisterInfo &MRI, unsigned MIFlags=0)
emitThumbRegPlusImmediate - Emits a series of instructions to materialize a destreg = basereg + immed...
void setDPRCalleeSavedAreaSize(unsigned s)
bool hasStackFrame() const
int getOffsetAdjustment() const
Return the correction for frame offsets.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
iterator_range< const_set_bits_iterator > set_bits() const
unsigned getFramePtrSpillOffset() const
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
void addReg(MCPhysReg Reg)
Adds a physical register and all its sub-registers to the set.
static void emitPrologueEpilogueSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator &MBBI, const TargetInstrInfo &TII, const DebugLoc &dl, const ThumbRegisterInfo &MRI, int NumBytes, unsigned ScratchReg, unsigned MIFlags)
static const unsigned FramePtr
static void findTemporariesForLR(const BitVector &GPRsNoLRSP, const BitVector &PopFriendly, const LivePhysRegs &UsedRegs, unsigned &PopReg, unsigned &TmpReg)
BitVector getPristineRegs(const MachineFunction &MF) const
Return a set of physical registers that are pristine.
Register getReg() const
getReg - Returns the register number.
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...
const MachineOperand & getOperand(unsigned i) const
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Wrapper class representing virtual and physical registers.
This class contains meta information specific to a module.