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;
33 int getFrameIndexReference(const MachineFunction &MF, int FI,
34 unsigned &FrameReg) const override;
36 void processFunctionBeforeFrameFinalized(
38 RegScavenger *RS = nullptr) const override;
41 void emitFlatScratchInit(const SISubtarget &ST,
43 MachineBasicBlock &MBB) const;
45 unsigned getReservedPrivateSegmentBufferReg(
46 const SISubtarget &ST,
47 const SIInstrInfo *TII,
48 const SIRegisterInfo *TRI,
49 SIMachineFunctionInfo *MFI,
50 MachineFunction &MF) const;
52 unsigned getReservedPrivateSegmentWaveByteOffsetReg(
53 const SISubtarget &ST,
54 const SIInstrInfo *TII,
55 const SIRegisterInfo *TRI,
56 SIMachineFunctionInfo *MFI,
57 MachineFunction &MF) const;
59 /// \brief Emits debugger prologue.
60 void emitDebuggerPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const;
63 } // end namespace llvm
65 #endif // LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H