1 //===--------------------- SIFrameLowering.h --------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
11 #define LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
13 #include "AMDGPUFrameLowering.h"
18 class SIMachineFunctionInfo;
22 class SIFrameLowering final : public AMDGPUFrameLowering {
24 SIFrameLowering(StackDirection D, unsigned StackAl, int LAO,
25 unsigned TransAl = 1) :
26 AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}
27 ~SIFrameLowering() override = default;
29 void emitPrologue(MachineFunction &MF,
30 MachineBasicBlock &MBB) const override;
31 void emitEpilogue(MachineFunction &MF,
32 MachineBasicBlock &MBB) const override;
34 void processFunctionBeforeFrameFinalized(
36 RegScavenger *RS = nullptr) const override;
39 void emitFlatScratchInit(const SIInstrInfo *TII,
40 const SIRegisterInfo* TRI,
42 MachineBasicBlock &MBB) const;
44 unsigned getReservedPrivateSegmentBufferReg(
45 const SISubtarget &ST,
46 const SIInstrInfo *TII,
47 const SIRegisterInfo *TRI,
48 SIMachineFunctionInfo *MFI,
49 MachineFunction &MF) const;
51 unsigned getReservedPrivateSegmentWaveByteOffsetReg(
52 const SISubtarget &ST,
53 const SIInstrInfo *TII,
54 const SIRegisterInfo *TRI,
55 SIMachineFunctionInfo *MFI,
56 MachineFunction &MF) const;
58 /// \brief Emits debugger prologue.
59 void emitDebuggerPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const;
62 } // end namespace llvm
64 #endif // LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H