LLVM  14.0.0git
Macros | Functions | Variables
SIFrameLowering.cpp File Reference
#include "SIFrameLowering.h"
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIMachineFunctionInfo.h"
#include "llvm/CodeGen/LivePhysRegs.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/Target/TargetMachine.h"
Include dependency graph for SIFrameLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "frame-info"
 

Functions

static MCRegister findScratchNonCalleeSaveRegister (MachineRegisterInfo &MRI, LivePhysRegs &LiveRegs, const TargetRegisterClass &RC, bool Unused=false)
 
static void getVGPRSpillLaneOrTempRegister (MachineFunction &MF, LivePhysRegs &LiveRegs, Register &TempSGPR, Optional< int > &FrameIndex, bool IsFP)
 
static void buildPrologSpill (const GCNSubtarget &ST, const SIRegisterInfo &TRI, const SIMachineFunctionInfo &FuncInfo, LivePhysRegs &LiveRegs, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Register SpillReg, int FI)
 
static void buildEpilogRestore (const GCNSubtarget &ST, const SIRegisterInfo &TRI, const SIMachineFunctionInfo &FuncInfo, LivePhysRegs &LiveRegs, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Register SpillReg, int FI)
 
static void buildGitPtr (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, const SIInstrInfo *TII, Register TargetReg)
 
static bool allStackObjectsAreDead (const MachineFrameInfo &MFI)
 
static unsigned getScratchScaleFactor (const GCNSubtarget &ST)
 
static void initLiveRegs (LivePhysRegs &LiveRegs, const SIRegisterInfo &TRI, const SIMachineFunctionInfo *FuncInfo, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool IsProlog)
 
static Register buildScratchExecCopy (LivePhysRegs &LiveRegs, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool IsProlog)
 
static bool spilledToMemory (const MachineFunction &MF, int SaveIndex)
 
static bool allSGPRSpillsAreDead (const MachineFunction &MF)
 
static bool frameTriviallyRequiresSP (const MachineFrameInfo &MFI)
 Returns true if the frame will require a reference to the stack pointer. More...
 

Variables

static cl::opt< bool > EnableSpillVGPRToAGPR ("amdgpu-spill-vgpr-to-agpr", cl::desc("Enable spilling VGPRs to AGPRs"), cl::ReallyHidden, cl::init(true))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "frame-info"

Definition at line 21 of file SIFrameLowering.cpp.

Function Documentation

◆ allSGPRSpillsAreDead()

static bool allSGPRSpillsAreDead ( const MachineFunction MF)
static

◆ allStackObjectsAreDead()

static bool allStackObjectsAreDead ( const MachineFrameInfo MFI)
static

◆ buildEpilogRestore()

static void buildEpilogRestore ( const GCNSubtarget ST,
const SIRegisterInfo TRI,
const SIMachineFunctionInfo FuncInfo,
LivePhysRegs LiveRegs,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
Register  SpillReg,
int  FI 
)
static

◆ buildGitPtr()

static void buildGitPtr ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
const SIInstrInfo TII,
Register  TargetReg 
)
static

◆ buildPrologSpill()

static void buildPrologSpill ( const GCNSubtarget ST,
const SIRegisterInfo TRI,
const SIMachineFunctionInfo FuncInfo,
LivePhysRegs LiveRegs,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
Register  SpillReg,
int  FI 
)
static

◆ buildScratchExecCopy()

static Register buildScratchExecCopy ( LivePhysRegs LiveRegs,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
bool  IsProlog 
)
static

◆ findScratchNonCalleeSaveRegister()

static MCRegister findScratchNonCalleeSaveRegister ( MachineRegisterInfo MRI,
LivePhysRegs LiveRegs,
const TargetRegisterClass RC,
bool  Unused = false 
)
static

◆ frameTriviallyRequiresSP()

static bool frameTriviallyRequiresSP ( const MachineFrameInfo MFI)
static

Returns true if the frame will require a reference to the stack pointer.

This is the set of conditions common to setting up the stack pointer in a kernel, and for using a frame pointer in a callable function.

FIXME: Should also check hasOpaqueSPAdjustment and if any inline asm references SP.

Definition at line 1398 of file SIFrameLowering.cpp.

References llvm::MachineFrameInfo::hasPatchPoint(), llvm::MachineFrameInfo::hasStackMap(), and llvm::MachineFrameInfo::hasVarSizedObjects().

Referenced by llvm::SIFrameLowering::hasFP(), and llvm::SIFrameLowering::requiresStackPointerReference().

◆ getScratchScaleFactor()

static unsigned getScratchScaleFactor ( const GCNSubtarget ST)
static

◆ getVGPRSpillLaneOrTempRegister()

static void getVGPRSpillLaneOrTempRegister ( MachineFunction MF,
LivePhysRegs LiveRegs,
Register TempSGPR,
Optional< int > &  FrameIndex,
bool  IsFP 
)
static

◆ initLiveRegs()

static void initLiveRegs ( LivePhysRegs LiveRegs,
const SIRegisterInfo TRI,
const SIMachineFunctionInfo FuncInfo,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
bool  IsProlog 
)
static

◆ spilledToMemory()

static bool spilledToMemory ( const MachineFunction MF,
int  SaveIndex 
)
static

Variable Documentation

◆ EnableSpillVGPRToAGPR

cl::opt<bool> EnableSpillVGPRToAGPR("amdgpu-spill-vgpr-to-agpr", cl::desc("Enable spilling VGPRs to AGPRs"), cl::ReallyHidden, cl::init(true))
static