LLVM  4.0.0
SystemZFrameLowering.h
Go to the documentation of this file.
1 //===-- SystemZFrameLowering.h - Frame lowering for SystemZ -----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZFRAMELOWERING_H
11 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZFRAMELOWERING_H
12 
13 #include "llvm/ADT/IndexedMap.h"
15 
16 namespace llvm {
17 class SystemZTargetMachine;
18 class SystemZSubtarget;
19 
21  IndexedMap<unsigned> RegSpillOffsets;
22 
23 public:
25 
26  // Override TargetFrameLowering.
27  bool isFPCloseToIncomingSP() const override { return false; }
28  const SpillSlot *getCalleeSavedSpillSlots(unsigned &NumEntries) const
29  override;
30  void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
31  RegScavenger *RS) const override;
34  const std::vector<CalleeSavedInfo> &CSI,
35  const TargetRegisterInfo *TRI) const override;
38  const std::vector<CalleeSavedInfo> &CSI,
39  const TargetRegisterInfo *TRI) const
40  override;
42  RegScavenger *RS) const override;
43  void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
44  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
45  bool hasFP(const MachineFunction &MF) const override;
46  int getFrameIndexReference(const MachineFunction &MF, int FI,
47  unsigned &FrameReg) const override;
48  bool hasReservedCallFrame(const MachineFunction &MF) const override;
51  MachineBasicBlock::iterator MI) const override;
52 
53  // Return the number of bytes in the callee-allocated part of the frame.
54  uint64_t getAllocatedStackSize(const MachineFunction &MF) const;
55 
56  // Return the byte offset from the incoming stack pointer of Reg's
57  // ABI-defined save slot. Return 0 if no slot is defined for Reg.
58  unsigned getRegSpillOffset(unsigned Reg) const {
59  return RegSpillOffsets[Reg];
60  }
61 };
62 } // end namespace llvm
63 
64 #endif
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
unsigned getRegSpillOffset(unsigned Reg) const
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS) const override
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...
bool hasReservedCallFrame(const MachineFunction &MF) const override
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.
void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs, RegScavenger *RS) const override
This method determines which of the registers reported by TargetRegisterInfo::getCalleeSavedRegs() sh...
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const override
getFrameIndexReference - This method should return the base register and offset used to reference a f...
MachineBasicBlock::iterator eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
This method is called during prolog/epilog code insertion to eliminate call frame setup and destroy p...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
Reg
All possible values of the reg field in the ModR/M byte.
MachineBasicBlock * MBB
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
bool isFPCloseToIncomingSP() const override
isFPCloseToIncomingSP - Return true if the frame pointer is close to the incoming stack pointer...
uint64_t getAllocatedStackSize(const MachineFunction &MF) const
Information about stack frame layout on the target.
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBII, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
const SpillSlot * getCalleeSavedSpillSlots(unsigned &NumEntries) const override
getCalleeSavedSpillSlots - This method returns a pointer to an array of pairs, that contains an entry...
IRTranslator LLVM IR MI
bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
spillCalleeSavedRegisters - Issues instruction(s) to spill all callee saved registers and returns tru...