2015-11-07 02:17:45 +08:00
|
|
|
//===--------------------- SIFrameLowering.h --------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
|
|
|
|
#define LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
|
|
|
|
|
|
|
|
#include "AMDGPUFrameLowering.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
2016-12-10 06:06:55 +08:00
|
|
|
|
2016-09-01 05:52:21 +08:00
|
|
|
class SIInstrInfo;
|
|
|
|
class SIMachineFunctionInfo;
|
|
|
|
class SIRegisterInfo;
|
|
|
|
class SISubtarget;
|
2015-11-07 02:17:45 +08:00
|
|
|
|
|
|
|
class SIFrameLowering final : public AMDGPUFrameLowering {
|
|
|
|
public:
|
|
|
|
SIFrameLowering(StackDirection D, unsigned StackAl, int LAO,
|
|
|
|
unsigned TransAl = 1) :
|
|
|
|
AMDGPUFrameLowering(D, StackAl, LAO, TransAl) {}
|
2016-12-10 06:06:55 +08:00
|
|
|
~SIFrameLowering() override = default;
|
2015-11-07 02:17:45 +08:00
|
|
|
|
2015-12-01 05:15:53 +08:00
|
|
|
void emitPrologue(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB) const override;
|
2016-06-24 14:30:11 +08:00
|
|
|
void emitEpilogue(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB) const override;
|
2015-12-01 05:15:53 +08:00
|
|
|
|
2015-11-07 02:17:45 +08:00
|
|
|
void processFunctionBeforeFrameFinalized(
|
|
|
|
MachineFunction &MF,
|
|
|
|
RegScavenger *RS = nullptr) const override;
|
2016-06-25 11:11:28 +08:00
|
|
|
|
|
|
|
private:
|
2016-09-01 05:52:21 +08:00
|
|
|
void emitFlatScratchInit(const SIInstrInfo *TII,
|
|
|
|
const SIRegisterInfo* TRI,
|
|
|
|
MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB) const;
|
|
|
|
|
|
|
|
unsigned getReservedPrivateSegmentBufferReg(
|
|
|
|
const SISubtarget &ST,
|
|
|
|
const SIInstrInfo *TII,
|
|
|
|
const SIRegisterInfo *TRI,
|
|
|
|
SIMachineFunctionInfo *MFI,
|
|
|
|
MachineFunction &MF) const;
|
|
|
|
|
|
|
|
unsigned getReservedPrivateSegmentWaveByteOffsetReg(
|
|
|
|
const SISubtarget &ST,
|
|
|
|
const SIInstrInfo *TII,
|
|
|
|
const SIRegisterInfo *TRI,
|
|
|
|
SIMachineFunctionInfo *MFI,
|
|
|
|
MachineFunction &MF) const;
|
|
|
|
|
2016-06-25 11:11:28 +08:00
|
|
|
/// \brief Emits debugger prologue.
|
|
|
|
void emitDebuggerPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const;
|
2015-11-07 02:17:45 +08:00
|
|
|
};
|
|
|
|
|
2016-12-10 06:06:55 +08:00
|
|
|
} // end namespace llvm
|
2015-11-07 02:17:45 +08:00
|
|
|
|
2016-12-10 06:06:55 +08:00
|
|
|
#endif // LLVM_LIB_TARGET_AMDGPU_SIFRAMELOWERING_H
|