LLVM  10.0.0
SystemZFrameLowering.h
Go to the documentation of this file.
1 //===-- SystemZFrameLowering.h - Frame lowering for SystemZ -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZFRAMELOWERING_H
10 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZFRAMELOWERING_H
11 
12 #include "llvm/ADT/IndexedMap.h"
14 
15 namespace llvm {
16 class SystemZTargetMachine;
17 class SystemZSubtarget;
18 
20  IndexedMap<unsigned> RegSpillOffsets;
21 
22 public:
24 
25  // Override TargetFrameLowering.
26  bool isFPCloseToIncomingSP() const override { return false; }
27  bool
29  const TargetRegisterInfo *TRI,
30  std::vector<CalleeSavedInfo> &CSI) const override;
31  void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
32  RegScavenger *RS) const override;
35  const std::vector<CalleeSavedInfo> &CSI,
36  const TargetRegisterInfo *TRI) const override;
39  std::vector<CalleeSavedInfo> &CSI,
40  const TargetRegisterInfo *TRI) const
41  override;
43  RegScavenger *RS) const override;
44  void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
45  void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
46  bool hasFP(const MachineFunction &MF) const override;
47  bool hasReservedCallFrame(const MachineFunction &MF) const override;
48  int getFrameIndexReference(const MachineFunction &MF, int FI,
49  unsigned &FrameReg) const override;
52  MachineBasicBlock::iterator MI) const override;
53 
54  // Return the byte offset from the incoming stack pointer of Reg's
55  // ABI-defined save slot. Return 0 if no slot is defined for Reg.
56  unsigned getRegSpillOffset(unsigned Reg) const {
57  return RegSpillOffsets[Reg];
58  }
59 
60  // Get or create the frame index of where the old frame pointer is stored.
62 };
63 } // end namespace llvm
64 
65 #endif
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
This class represents lattice values for constants.
Definition: AllocatorList.h:23
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS) const override
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...
unsigned Reg
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.
unsigned const TargetRegisterInfo * TRI
bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBII, std::vector< CalleeSavedInfo > &CSI, const TargetRegisterInfo *TRI) const override
restoreCalleeSavedRegisters - Issues instruction(s) to restore all callee saved registers and returns...
unsigned getRegSpillOffset(unsigned Reg) const
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
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
int getOrCreateFramePointerSaveIndex(MachineFunction &MF) const
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...
Information about stack frame layout on the target.
bool assignCalleeSavedSpillSlots(MachineFunction &MF, const TargetRegisterInfo *TRI, std::vector< CalleeSavedInfo > &CSI) const override
assignCalleeSavedSpillSlots - Allows target to override spill slot assignment logic.
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...