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" 14 #include "llvm/CodeGen/TargetFrameLowering.h" 15 16 namespace llvm { 17 class SystemZTargetMachine; 18 class SystemZSubtarget; 19 20 class SystemZFrameLowering : public TargetFrameLowering { 21 IndexedMap<unsigned> RegSpillOffsets; 22 23 public: 24 SystemZFrameLowering(); 25 26 // Override TargetFrameLowering. isFPCloseToIncomingSP()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; 32 bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, 33 MachineBasicBlock::iterator MBBI, 34 const std::vector<CalleeSavedInfo> &CSI, 35 const TargetRegisterInfo *TRI) const override; 36 bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, 37 MachineBasicBlock::iterator MBBII, 38 std::vector<CalleeSavedInfo> &CSI, 39 const TargetRegisterInfo *TRI) const 40 override; 41 void processFunctionBeforeFrameFinalized(MachineFunction &MF, 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 bool hasReservedCallFrame(const MachineFunction &MF) const override; 47 MachineBasicBlock::iterator 48 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, 49 MachineBasicBlock::iterator MI) const override; 50 51 // Return the byte offset from the incoming stack pointer of Reg's 52 // ABI-defined save slot. Return 0 if no slot is defined for Reg. getRegSpillOffset(unsigned Reg)53 unsigned getRegSpillOffset(unsigned Reg) const { 54 return RegSpillOffsets[Reg]; 55 } 56 }; 57 } // end namespace llvm 58 59 #endif 60