LLVM API Documentation
#include <SystemZFrameLowering.h>
Definition at line 20 of file SystemZFrameLowering.h.
Definition at line 49 of file SystemZFrameLowering.cpp.
References llvm::array_lengthof(), llvm::IndexedMap< T, ToIndexT >::grow(), and I.
void SystemZFrameLowering::eliminateCallFramePseudoInstr | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB, | ||
MachineBasicBlock::iterator | MI | ||
) | const [override, virtual] |
eliminateCallFramePseudoInstr - This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy pseudo instructions (but only if the Target is using them). It is responsible for eliminating these instructions, replacing them with concrete instructions. This method need only be implemented if using call frame setup/destroy pseudo instructions.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 501 of file SystemZFrameLowering.cpp.
References llvm::MachineBasicBlock::erase(), hasReservedCallFrame(), and llvm_unreachable.
void SystemZFrameLowering::emitEpilogue | ( | MachineFunction & | MF, |
MachineBasicBlock & | MBB | ||
) | const [override, virtual] |
Implements llvm::TargetFrameLowering.
Definition at line 409 of file SystemZFrameLowering.cpp.
References emitIncrement(), getAllocatedStackSize(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::SystemZMachineFunctionInfo::getLowSavedGPR(), llvm::MachineFunction::getSubtarget(), and llvm_unreachable.
void SystemZFrameLowering::emitPrologue | ( | MachineFunction & | MF | ) | const [override, virtual] |
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
Implements llvm::TargetFrameLowering.
Definition at line 312 of file SystemZFrameLowering.cpp.
References llvm::MachineModuleInfo::addFrameInst(), llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), llvm::BuildMI(), llvm::SystemZMC::CFAOffsetFromInitialSP, llvm::TargetOpcode::CFI_INSTRUCTION, contains(), llvm::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), emitIncrement(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MachineFunction::front(), llvm::DebugLoc::get(), getAllocatedStackSize(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), getFrameIndexOffset(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::SystemZMachineFunctionInfo::getLowSavedGPR(), llvm::MachineFunction::getMMI(), llvm::MCContext::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), hasFP(), I, llvm_unreachable, and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
uint64_t SystemZFrameLowering::getAllocatedStackSize | ( | const MachineFunction & | MF | ) | const |
Definition at line 476 of file SystemZFrameLowering.cpp.
References llvm::SystemZMC::CallFrameSize, llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getStackSize(), llvm::MachineFrameInfo::hasCalls(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by emitEpilogue(), emitPrologue(), and getFrameIndexOffset().
const TargetFrameLowering::SpillSlot * SystemZFrameLowering::getCalleeSavedSpillSlots | ( | unsigned & | NumEntries | ) | const [override, virtual] |
getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry for each callee saved register that must be spilled to a particular stack location if it is spilled.
Each entry in this array contains a <register,offset> pair, indicating the fixed offset from the incoming stack pointer that each register should be spilled at. If a register is not listed here, the code generator is allowed to spill it anywhere it chooses.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 59 of file SystemZFrameLowering.cpp.
References llvm::array_lengthof().
int SystemZFrameLowering::getFrameIndexOffset | ( | const MachineFunction & | MF, |
int | FI | ||
) | const [override, virtual] |
getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index.
getFrameIndexOffset - Returns the displacement from the frame register to the stack frame of the specified index. This is the default implementation which is overridden for some targets.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 456 of file SystemZFrameLowering.cpp.
References getAllocatedStackSize(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), and llvm::TargetFrameLowering::getOffsetOfLocalArea().
Referenced by emitPrologue().
unsigned llvm::SystemZFrameLowering::getRegSpillOffset | ( | unsigned | Reg | ) | const [inline] |
Definition at line 58 of file SystemZFrameLowering.h.
bool SystemZFrameLowering::hasFP | ( | const MachineFunction & | MF | ) | const [override, virtual] |
hasFP - Return true if the specified function should have a dedicated frame pointer register. For most targets this is true only if the function has variable sized allocas or if frame pointer elimination is disabled.
Implements llvm::TargetFrameLowering.
Definition at line 450 of file SystemZFrameLowering.cpp.
References llvm::TargetOptions::DisableFramePointerElim(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getTarget(), llvm::MachineFrameInfo::hasVarSizedObjects(), and llvm::TargetMachine::Options.
Referenced by emitPrologue(), processFunctionBeforeCalleeSavedScan(), and restoreCalleeSavedRegisters().
bool SystemZFrameLowering::hasReservedCallFrame | ( | const MachineFunction & | MF | ) | const [override, virtual] |
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. This eliminates the need for add/sub sp brackets around call sites. Returns true if the call frame is included as part of the stack frame.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 492 of file SystemZFrameLowering.cpp.
Referenced by eliminateCallFramePseudoInstr().
bool llvm::SystemZFrameLowering::isFPCloseToIncomingSP | ( | ) | const [inline, override, virtual] |
isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer, false if it is close to the post-prologue stack pointer.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 27 of file SystemZFrameLowering.h.
void SystemZFrameLowering::processFunctionBeforeCalleeSavedScan | ( | MachineFunction & | MF, |
RegScavenger * | RS | ||
) | const [override, virtual] |
processFunctionBeforeCalleeSavedScan - This method is called immediately before PrologEpilogInserter scans the physical registers used to determine what callee saved registers should be spilled. This method is optional.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 65 of file SystemZFrameLowering.cpp.
References llvm::SystemZ::ArgGPRs, contains(), llvm::TargetRegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR(), llvm::MachineFrameInfo::hasCalls(), hasFP(), I, llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::Function::isVarArg(), llvm::SystemZ::NumArgGPRs, and llvm::MachineRegisterInfo::setPhysRegUsed().
void SystemZFrameLowering::processFunctionBeforeFrameFinalized | ( | MachineFunction & | MF, |
RegScavenger * | RS | ||
) | const [override, virtual] |
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function's frame layout (MF.getFrameInfo()) is finalized. Once the frame is finalized, MO_FrameIndex operands are replaced with direct constants. This method is optional.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 268 of file SystemZFrameLowering.cpp.
References llvm::RegScavenger::addScavengingFrameIndex(), llvm::SystemZMC::CallFrameSize, llvm::MachineFrameInfo::CreateStackObject(), llvm::MachineFrameInfo::estimateStackSize(), and llvm::MachineFunction::getFrameInfo().
bool SystemZFrameLowering::restoreCalleeSavedRegisters | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
const std::vector< CalleeSavedInfo > & | CSI, | ||
const TargetRegisterInfo * | TRI | ||
) | const [override, virtual] |
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of load instructions via loadRegToStackSlot(). Returns false otherwise.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 213 of file SystemZFrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), contains(), llvm::RegState::Define, llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::SystemZMachineFunctionInfo::getHighSavedGPR(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::SystemZMachineFunctionInfo::getLowSavedGPR(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), hasFP(), I, llvm::RegState::ImplicitDefine, llvm::TargetInstrInfo::loadRegFromStackSlot(), and TII.
bool SystemZFrameLowering::spillCalleeSavedRegisters | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | MI, | ||
const std::vector< CalleeSavedInfo > & | CSI, | ||
const TargetRegisterInfo * | TRI | ||
) | const [override, virtual] |
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns true if it isn't possible / profitable to do so by issuing a series of store instructions via storeRegToStackSlot(). Returns false otherwise.
Reimplemented from llvm::TargetFrameLowering.
Definition at line 124 of file SystemZFrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineInstrBuilder::addReg(), addSavedGPR(), llvm::SystemZ::ArgGPRs, llvm::BuildMI(), contains(), llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getSubtarget(), llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR(), I, llvm::Function::isVarArg(), llvm::SystemZ::NumArgGPRs, llvm::SystemZMachineFunctionInfo::setHighSavedGPR(), llvm::SystemZMachineFunctionInfo::setLowSavedGPR(), llvm::TargetInstrInfo::storeRegToStackSlot(), and TII.