LLVM 20.0.0git
Classes | Namespaces | 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/LiveRegUnits.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/Target/TargetMachine.h"

Go to the source code of this file.

Classes

class  llvm::PrologEpilogSGPRSpillBuilder
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define DEBUG_TYPE   "frame-info"
 

Functions

static MCRegister findUnusedRegister (MachineRegisterInfo &MRI, const LiveRegUnits &LiveUnits, const TargetRegisterClass &RC)
 
static MCRegister findScratchNonCalleeSaveRegister (MachineRegisterInfo &MRI, LiveRegUnits &LiveUnits, const TargetRegisterClass &RC, bool Unused=false)
 
static void getVGPRSpillLaneOrTempRegister (MachineFunction &MF, LiveRegUnits &LiveUnits, Register SGPR, const TargetRegisterClass &RC=AMDGPU::SReg_32_XM0_XEXECRegClass, bool IncludeScratchCopy=true)
 Query target location for spilling SGPRs IncludeScratchCopy : Also look for free scratch SGPRs.
 
static void buildPrologSpill (const GCNSubtarget &ST, const SIRegisterInfo &TRI, const SIMachineFunctionInfo &FuncInfo, LiveRegUnits &LiveUnits, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register SpillReg, int FI, Register FrameReg, int64_t DwordOff=0)
 
static void buildEpilogRestore (const GCNSubtarget &ST, const SIRegisterInfo &TRI, const SIMachineFunctionInfo &FuncInfo, LiveRegUnits &LiveUnits, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register SpillReg, int FI, Register FrameReg, int64_t DwordOff=0)
 
static void buildGitPtr (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, const SIInstrInfo *TII, Register TargetReg)
 
static void initLiveUnits (LiveRegUnits &LiveUnits, const SIRegisterInfo &TRI, const SIMachineFunctionInfo *FuncInfo, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, bool IsProlog)
 
static bool allStackObjectsAreDead (const MachineFrameInfo &MFI)
 
static unsigned getScratchScaleFactor (const GCNSubtarget &ST)
 
static Register buildScratchExecCopy (LiveRegUnits &LiveUnits, MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, const DebugLoc &DL, bool IsProlog, bool EnableInactiveLanes)
 
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.
 

Variables

static cl::opt< boolEnableSpillVGPRToAGPR ("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,
LiveRegUnits LiveUnits,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  SpillReg,
int  FI,
Register  FrameReg,
int64_t  DwordOff = 0 
)
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,
LiveRegUnits LiveUnits,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
Register  SpillReg,
int  FI,
Register  FrameReg,
int64_t  DwordOff = 0 
)
static

◆ buildScratchExecCopy()

static Register buildScratchExecCopy ( LiveRegUnits LiveUnits,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
const DebugLoc DL,
bool  IsProlog,
bool  EnableInactiveLanes 
)
static

◆ findScratchNonCalleeSaveRegister()

static MCRegister findScratchNonCalleeSaveRegister ( MachineRegisterInfo MRI,
LiveRegUnits LiveUnits,
const TargetRegisterClass RC,
bool  Unused = false 
)
static

◆ findUnusedRegister()

static MCRegister findUnusedRegister ( MachineRegisterInfo MRI,
const LiveRegUnits LiveUnits,
const TargetRegisterClass RC 
)
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 1807 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,
LiveRegUnits LiveUnits,
Register  SGPR,
const TargetRegisterClass RC = AMDGPU::SReg_32_XM0_XEXECRegClass,
bool  IncludeScratchCopy = true 
)
static

◆ initLiveUnits()

static void initLiveUnits ( LiveRegUnits LiveUnits,
const SIRegisterInfo TRI,
const SIMachineFunctionInfo FuncInfo,
MachineFunction MF,
MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
bool  IsProlog 
)
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)) ( "amdgpu-spill-vgpr-to-agpr"  ,
cl::desc("Enable spilling VGPRs to AGPRs")  ,
cl::ReallyHidden  ,
cl::init(true  
)
static