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 emitEntryFunctionPrologue(MachineFunction &MF,
30 MachineBasicBlock &MBB) const;
31 void emitPrologue(MachineFunction &MF,
32 MachineBasicBlock &MBB) const override;
33 void emitEpilogue(MachineFunction &MF,
34 MachineBasicBlock &MBB) const override;
35 int getFrameIndexReference(const MachineFunction &MF, int FI,
36 unsigned &FrameReg) const override;
38 void processFunctionBeforeFrameFinalized(
40 RegScavenger *RS = nullptr) const override;
43 void emitFlatScratchInit(const SISubtarget &ST,
45 MachineBasicBlock &MBB) const;
47 unsigned getReservedPrivateSegmentBufferReg(
48 const SISubtarget &ST,
49 const SIInstrInfo *TII,
50 const SIRegisterInfo *TRI,
51 SIMachineFunctionInfo *MFI,
52 MachineFunction &MF) const;
54 std::pair<unsigned, unsigned> getReservedPrivateSegmentWaveByteOffsetReg(
55 const SISubtarget &ST,
56 const SIInstrInfo *TII,
57 const SIRegisterInfo *TRI,
58 SIMachineFunctionInfo *MFI,
59 MachineFunction &MF) const;
61 /// \brief Emits debugger prologue.
62 void emitDebuggerPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const;
65 } // end namespace llvm
67 #endif // LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H