Go to the documentation of this file.
42 assert(&MF.
front() == &
MBB &&
"Shrink-wrapping not yet supported");
54 uint64_t NumBytes = 0;
57 uint64_t FrameSize = StackSize - 2;
82 while (
MBBI !=
MBB.
end() && (
MBBI->getOpcode() == MSP430::PUSH16r))
101 MI->getOperand(3).setIsDead();
114 unsigned RetOpcode =
MBBI->getOpcode();
119 case MSP430::RETI:
break;
127 uint64_t NumBytes = 0;
131 uint64_t FrameSize = StackSize - 2;
132 NumBytes = FrameSize - CSSize;
137 NumBytes = StackSize - CSSize;
142 unsigned Opc = PI->getOpcode();
143 if (Opc != MSP430::POP16r && !PI->isTerminator())
161 TII.get(MSP430::SUB16ri), MSP430::SP)
164 MI->getOperand(3).setIsDead();
173 MI->getOperand(3).setIsDead();
193 for (
unsigned i = CSI.
size();
i != 0; --
i) {
194 unsigned Reg = CSI[
i-1].getReg();
215 for (
unsigned i = 0,
e = CSI.
size();
i !=
e; ++
i)
232 uint64_t Amount =
TII.getFrameSize(Old);
248 Amount -=
TII.getFramePoppedByCallee(Old);
258 New->getOperand(3).setIsDead();
264 }
else if (
I->getOpcode() ==
TII.getCallFrameDestroyOpcode()) {
267 if (uint64_t CalleeAmt =
TII.getFramePoppedByCallee(*
I)) {
274 New->getOperand(3).setIsDead();
291 "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.
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
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...
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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.
@ Kill
The last use of a register.
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
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),...
iterator getLastNonDebugInstr(bool SkipPseudoOp=false)
Returns an iterator to the last non-debug instruction in the basic block, or end().
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
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.
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.
Iterator for intrusive lists based on ilist_node.
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...
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
size_t size() const
size - Get the array size.
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...