blob: 79654b46f9482f4d6ae1f12cc722b26b7c547a11 [file] [log] [blame]
Matt Arsenault0c90e952015-11-06 18:17:45 +00001//===--------------------- SIFrameLowering.h --------------------*- 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_AMDGPU_SIFRAMELOWERING_H
11#define LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
12
13#include "AMDGPUFrameLowering.h"
14
15namespace llvm {
Matt Arsenault57bc4322016-08-31 21:52:21 +000016class SIInstrInfo;
17class SIMachineFunctionInfo;
18class SIRegisterInfo;
19class SISubtarget;
Matt Arsenault0c90e952015-11-06 18:17:45 +000020
21class SIFrameLowering final : public AMDGPUFrameLowering {
22public:
23 SIFrameLowering(StackDirection D, unsigned StackAl, int LAO,
24 unsigned TransAl = 1) :
25 AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}
26 ~SIFrameLowering() override {}
27
Matt Arsenault0e3d3892015-11-30 21:15:53 +000028 void emitPrologue(MachineFunction &MF,
29 MachineBasicBlock &MBB) const override;
Matt Arsenault43e92fe2016-06-24 06:30:11 +000030 void emitEpilogue(MachineFunction &MF,
31 MachineBasicBlock &MBB) const override;
Matt Arsenault0e3d3892015-11-30 21:15:53 +000032
Matt Arsenault0c90e952015-11-06 18:17:45 +000033 void processFunctionBeforeFrameFinalized(
34 MachineFunction &MF,
35 RegScavenger *RS = nullptr) const override;
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +000036
37private:
Matt Arsenault57bc4322016-08-31 21:52:21 +000038 void emitFlatScratchInit(const SIInstrInfo *TII,
39 const SIRegisterInfo* TRI,
40 MachineFunction &MF,
41 MachineBasicBlock &MBB) const;
42
43 unsigned getReservedPrivateSegmentBufferReg(
44 const SISubtarget &ST,
45 const SIInstrInfo *TII,
46 const SIRegisterInfo *TRI,
47 SIMachineFunctionInfo *MFI,
48 MachineFunction &MF) const;
49
50 unsigned getReservedPrivateSegmentWaveByteOffsetReg(
51 const SISubtarget &ST,
52 const SIInstrInfo *TII,
53 const SIRegisterInfo *TRI,
54 SIMachineFunctionInfo *MFI,
55 MachineFunction &MF) const;
56
Konstantin Zhuravlyovf2f3d142016-06-25 03:11:28 +000057 /// \brief Emits debugger prologue.
58 void emitDebuggerPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const;
Matt Arsenault0c90e952015-11-06 18:17:45 +000059};
60
61}
62
63#endif