LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
llvm::SystemZFrameLowering Class Reference

#include <SystemZFrameLowering.h>

Inheritance diagram for llvm::SystemZFrameLowering:
Inheritance graph
[legend]
Collaboration diagram for llvm::SystemZFrameLowering:
Collaboration graph
[legend]

Public Member Functions

 SystemZFrameLowering (const SystemZTargetMachine &tm, const SystemZSubtarget &sti)
 
virtual bool isFPCloseToIncomingSP () const LLVM_OVERRIDE
 
virtual const SpillSlotgetCalleeSavedSpillSlots (unsigned &NumEntries) const LLVM_OVERRIDE
 
virtual void processFunctionBeforeCalleeSavedScan (MachineFunction &MF, RegScavenger *RS) const LLVM_OVERRIDE
 
virtual bool spillCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const LLVM_OVERRIDE
 
virtual bool restoreCalleeSavedRegisters (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBII, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const LLVM_OVERRIDE
 
virtual void processFunctionBeforeFrameFinalized (MachineFunction &MF, RegScavenger *RS) const
 
virtual void emitPrologue (MachineFunction &MF) const LLVM_OVERRIDE
 
virtual void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const LLVM_OVERRIDE
 
virtual bool hasFP (const MachineFunction &MF) const LLVM_OVERRIDE
 
virtual int getFrameIndexOffset (const MachineFunction &MF, int FI) const LLVM_OVERRIDE
 
virtual bool hasReservedCallFrame (const MachineFunction &MF) const LLVM_OVERRIDE
 
virtual void eliminateCallFramePseudoInstr (MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const LLVM_OVERRIDE
 
uint64_t getAllocatedStackSize (const MachineFunction &MF) const
 
unsigned getRegSpillOffset (unsigned Reg) const
 
- Public Member Functions inherited from llvm::TargetFrameLowering
 TargetFrameLowering (StackDirection D, unsigned StackAl, int LAO, unsigned TransAl=1, bool StackReal=true)
 
virtual ~TargetFrameLowering ()
 
StackDirection getStackGrowthDirection () const
 
unsigned getStackAlignment () const
 
unsigned getTransientStackAlignment () const
 
bool isStackRealignable () const
 
int getOffsetOfLocalArea () const
 
virtual bool targetHandlesStackFrameRounding () const
 
virtual void adjustForSegmentedStacks (MachineFunction &MF) const
 
virtual void adjustForHiPEPrologue (MachineFunction &MF) const
 
virtual bool canSimplifyCallFramePseudos (const MachineFunction &MF) const
 
virtual int getFrameIndexReference (const MachineFunction &MF, int FI, unsigned &FrameReg) const
 

Protected Attributes

const SystemZTargetMachineTM
 
const SystemZSubtargetSTI
 

Additional Inherited Members

- Public Types inherited from llvm::TargetFrameLowering
enum  StackDirection { StackGrowsUp, StackGrowsDown }
 

Detailed Description

Definition at line 21 of file SystemZFrameLowering.h.

Constructor & Destructor Documentation

SystemZFrameLowering::SystemZFrameLowering ( const SystemZTargetMachine tm,
const SystemZSubtarget sti 
)

Member Function Documentation

void SystemZFrameLowering::eliminateCallFramePseudoInstr ( MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const
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.

void SystemZFrameLowering::emitEpilogue ( MachineFunction MF,
MachineBasicBlock MBB 
) const
virtual
void SystemZFrameLowering::emitPrologue ( MachineFunction MF) const
virtual
uint64_t SystemZFrameLowering::getAllocatedStackSize ( const MachineFunction MF) const
const TargetFrameLowering::SpillSlot * SystemZFrameLowering::getCalleeSavedSpillSlots ( unsigned NumEntries) const
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
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().

unsigned llvm::SystemZFrameLowering::getRegSpillOffset ( unsigned  Reg) const
inline

Definition at line 72 of file SystemZFrameLowering.h.

bool SystemZFrameLowering::hasFP ( const MachineFunction MF) const
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().

bool SystemZFrameLowering::hasReservedCallFrame ( const MachineFunction MF) const
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().

virtual bool llvm::SystemZFrameLowering::isFPCloseToIncomingSP ( ) const
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.

void SystemZFrameLowering::processFunctionBeforeCalleeSavedScan ( MachineFunction MF,
RegScavenger RS 
) const
virtual
void SystemZFrameLowering::processFunctionBeforeFrameFinalized ( MachineFunction MF,
RegScavenger RS 
) const
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
virtual
bool SystemZFrameLowering::spillCalleeSavedRegisters ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
const std::vector< CalleeSavedInfo > &  CSI,
const TargetRegisterInfo TRI 
) const
virtual

Member Data Documentation

const SystemZSubtarget& llvm::SystemZFrameLowering::STI
protected

Definition at line 26 of file SystemZFrameLowering.h.

const SystemZTargetMachine& llvm::SystemZFrameLowering::TM
protected

Definition at line 25 of file SystemZFrameLowering.h.

Referenced by spillCalleeSavedRegisters().


The documentation for this class was generated from the following files: