Go to the documentation of this file.
42 assert(&MF.
front() == &
MBB &&
"Shrink-wrapping not yet supported");
81 while (
MBBI !=
MBB.
end() && (
MBBI->getOpcode() == MSP430::PUSH16r))
100 MI->getOperand(3).setIsDead();
113 unsigned RetOpcode =
MBBI->getOpcode();
118 case MSP430::RETI:
break;
131 NumBytes = FrameSize - CSSize;
136 NumBytes = StackSize - CSSize;
141 unsigned Opc = PI->getOpcode();
142 if (Opc != MSP430::POP16r && !PI->isTerminator())
160 TII.get(MSP430::SUB16ri), MSP430::SP)
163 MI->getOperand(3).setIsDead();
172 MI->getOperand(3).setIsDead();
247 Amount -=
TII.getFramePoppedByCallee(Old);
257 New->getOperand(3).setIsDead();
263 }
else if (
I->getOpcode() ==
TII.getCallFrameDestroyOpcode()) {
266 if (
uint64_t CalleeAmt =
TII.getFramePoppedByCallee(*
I)) {
273 New->getOperand(3).setIsDead();
290 "Slot for FP register must be last in order to be found!");
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
virtual const TargetInstrInfo * getInstrInfo() const
Reg
All possible values of the reg field in the ModR/M byte.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
unsigned const TargetRegisterInfo * TRI
bool empty() const
empty - Check if the array is empty.
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
MSP430MachineFunctionInfo - This class is derived from MachineFunction and contains private MSP430 ta...
const MachineBasicBlock & front() const
TargetInstrInfo - Interface to description of machine instruction set.
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Align getStackAlign() const
getStackAlignment - This method returns the number of bytes to which the stack pointer must be aligne...
const HexagonInstrInfo * TII
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
int getObjectIndexBegin() const
Return the minimum frame object index.
bool DisableFramePointerElim(const MachineFunction &MF) const
DisableFramePointerElim - This returns true if frame pointer elimination optimization should be disab...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
Representation of each machine instruction.
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
iterator getLastNonDebugInstr(bool SkipPseudoOp=true)
Returns an iterator to the last non-debug instruction in the basic block, or end().
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool IsImmutable, bool isAliased=false)
Create a new object at a fixed location on the stack.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
void setCalleeSavedFrameSize(unsigned bytes)
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, MutableArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
unsigned getCalleeSavedFrameSize() const
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
MachineBasicBlock MachineBasicBlock::iterator MBBI
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Wrapper class representing virtual and physical registers.
void addLiveIn(MCRegister PhysReg, LaneBitmask LaneMask=LaneBitmask::getAll())
Adds the specified register as a live in.
bool isFrameAddressTaken() const
This method may be called any time after instruction selection is complete to determine if there is a...
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register.
The CalleeSavedInfo class tracks the information need to locate where a callee saved register is in t...
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, ArrayRef< CalleeSavedInfo > CSI, const TargetRegisterInfo *TRI) const override
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...
@ Kill
The last use of a register.
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
size_t size() const
size - Get the array size.
auto reverse(ContainerTy &&C)
void setOffsetAdjustment(int Adj)
Set the correction for frame offsets.
bool hasReservedCallFrame(const MachineFunction &MF) const override
hasReservedCallFrame - Under normal circumstances, when a frame pointer is not required,...
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS=nullptr) const override
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...