LLVM API Documentation
#include <SystemZFrameLowering.h>
Protected Attributes | |
const SystemZTargetMachine & | TM |
const SystemZSubtarget & | STI |
Additional Inherited Members | |
![]() | |
enum | StackDirection { StackGrowsUp, StackGrowsDown } |
Definition at line 21 of file SystemZFrameLowering.h.
SystemZFrameLowering::SystemZFrameLowering | ( | const SystemZTargetMachine & | tm, |
const SystemZSubtarget & | sti | ||
) |
Definition at line 47 of file SystemZFrameLowering.cpp.
References llvm::array_lengthof(), llvm::IndexedMap< T, ToIndexT >::grow(), and I.
|
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 507 of file SystemZFrameLowering.cpp.
References llvm::MachineBasicBlock::erase(), hasReservedCallFrame(), and llvm_unreachable.
|
virtual |
Implements llvm::TargetFrameLowering.
Definition at line 415 of file SystemZFrameLowering.cpp.
References emitIncrement(), getAllocatedStackSize(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::SystemZMachineFunctionInfo::getLowSavedGPR(), llvm::SystemZInstrInfo::getOpcodeForOffset(), llvm::MachineFunction::getTarget(), and llvm_unreachable.
|
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::MCCFIInstruction::createDefCfaOffset(), llvm::MCCFIInstruction::createDefCfaRegister(), llvm::MCCFIInstruction::createOffset(), llvm::MCContext::CreateTempSymbol(), emitIncrement(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::MachineFunction::front(), getAllocatedStackSize(), llvm::MachineFrameInfo::getCalleeSavedInfo(), llvm::MachineModuleInfo::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), getFrameIndexOffset(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::SystemZMachineFunctionInfo::getLowSavedGPR(), llvm::MachineFunction::getMMI(), llvm::MCContext::getRegisterInfo(), llvm::MachineFunction::getTarget(), hasFP(), I, llvm_unreachable, MRI, llvm::next(), and llvm::TargetOpcode::PROLOG_LABEL.
uint64_t SystemZFrameLowering::getAllocatedStackSize | ( | const MachineFunction & | MF | ) | const |
Definition at line 482 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().
|
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().
|
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 462 of file SystemZFrameLowering.cpp.
References getAllocatedStackSize(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectOffset(), llvm::MachineFrameInfo::getOffsetAdjustment(), and llvm::TargetFrameLowering::getOffsetOfLocalArea().
Referenced by emitPrologue().
Definition at line 72 of file SystemZFrameLowering.h.
|
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 456 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().
|
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 498 of file SystemZFrameLowering.cpp.
Referenced by eliminateCallFramePseudoInstr().
|
inlinevirtual |
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 33 of file SystemZFrameLowering.h.
|
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, llvm::TargetRegisterInfo::getCalleeSavedRegs(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::TargetMachine::getRegisterInfo(), llvm::MachineFunction::getTarget(), llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR(), llvm::MachineFrameInfo::hasCalls(), hasFP(), I, llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::Function::isVarArg(), MRI, llvm::SystemZ::NumArgGPRs, and llvm::MachineRegisterInfo::setPhysRegUsed().
|
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().
|
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(), llvm::RegState::Define, llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::SystemZMachineFunctionInfo::getHighSavedGPR(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::SystemZMachineFunctionInfo::getLowSavedGPR(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getTarget(), hasFP(), I, llvm::RegState::ImplicitDefine, llvm::TargetInstrInfo::loadRegFromStackSlot(), and TII.
|
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(), llvm::MachineBasicBlock::end(), llvm::MCInstrInfo::get(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getTarget(), llvm::SystemZMachineFunctionInfo::getVarArgsFirstGPR(), I, llvm::Function::isVarArg(), llvm::SystemZ::NumArgGPRs, llvm::SystemZMachineFunctionInfo::setHighSavedGPR(), llvm::SystemZMachineFunctionInfo::setLowSavedGPR(), llvm::TargetInstrInfo::storeRegToStackSlot(), TII, and TM.
|
protected |
Definition at line 26 of file SystemZFrameLowering.h.
|
protected |
Definition at line 25 of file SystemZFrameLowering.h.
Referenced by spillCalleeSavedRegisters().