LLVM  5.0.0
SIFrameLowering.h
Go to the documentation of this file.
1 //===--------------------- 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 
15 namespace llvm {
16 
17 class SIInstrInfo;
18 class SIMachineFunctionInfo;
19 class SIRegisterInfo;
20 class SISubtarget;
21 
22 class SIFrameLowering final : public AMDGPUFrameLowering {
23 public:
24  SIFrameLowering(StackDirection D, unsigned StackAl, int LAO,
25  unsigned TransAl = 1) :
26  AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}
27  ~SIFrameLowering() override = default;
28 
30  MachineBasicBlock &MBB) const;
32  MachineBasicBlock &MBB) const override;
34  MachineBasicBlock &MBB) const override;
35  int getFrameIndexReference(const MachineFunction &MF, int FI,
36  unsigned &FrameReg) const override;
37 
39  MachineFunction &MF,
40  RegScavenger *RS = nullptr) const override;
41 
42 private:
43  void emitFlatScratchInit(const SISubtarget &ST,
44  MachineFunction &MF,
45  MachineBasicBlock &MBB) const;
46 
47  unsigned getReservedPrivateSegmentBufferReg(
48  const SISubtarget &ST,
49  const SIInstrInfo *TII,
50  const SIRegisterInfo *TRI,
52  MachineFunction &MF) const;
53 
54  std::pair<unsigned, unsigned> getReservedPrivateSegmentWaveByteOffsetReg(
55  const SISubtarget &ST,
56  const SIInstrInfo *TII,
57  const SIRegisterInfo *TRI,
59  MachineFunction &MF) const;
60 
61  /// \brief Emits debugger prologue.
62  void emitDebuggerPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const;
63 
64 public:
65  bool hasFP(const MachineFunction &MF) const override;
66  bool hasSP(const MachineFunction &MF) const;
67 };
68 
69 } // end namespace llvm
70 
71 #endif // LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const override
getFrameIndexReference - This method should return the base register and offset used to reference a f...
~SIFrameLowering() override=default
void processFunctionBeforeFrameFinalized(MachineFunction &MF, RegScavenger *RS=nullptr) const override
processFunctionBeforeFrameFinalized - This method is called immediately before the specified function...
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override
const HexagonInstrInfo * TII
Interface to describe a layout of a stack frame on an AMDGPU target.
void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override
emitProlog/emitEpilog - These methods insert prolog and epilog code into the function.
SIFrameLowering(StackDirection D, unsigned StackAl, int LAO, unsigned TransAl=1)
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
Information about the stack frame layout on the AMDGPU targets.
void emitEntryFunctionPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const
bool hasSP(const MachineFunction &MF) const
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
#define D
Definition: LargeTest.cpp:26