LLVM: lib/Target/AMDGPU/SIFrameLowering.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
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.

DEBUG_TYPE

#define DEBUG_TYPE "frame-info"

allSGPRSpillsAreDead()

allStackObjectsAreDead()

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()

Definition at line 177 of file SIFrameLowering.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::addLiveIn(), llvm::MachineRegisterInfo::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::SIMachineFunctionInfo::getGITPtrHigh(), llvm::SIMachineFunctionInfo::getGITPtrLoReg(), llvm::MachineFunction::getInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), I, llvm::RegState::ImplicitDefine, MBB, TII, and TRI.

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

Definition at line 134 of file SIFrameLowering.cpp.

References llvm::LiveRegUnits::addReg(), DL, llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), I, llvm::MachineBasicBlock::isLiveIn(), MBB, llvm::MachineMemOperand::MOStore, llvm::LiveRegUnits::removeReg(), and TRI.

Referenced by llvm::SIFrameLowering::emitCSRSpillStores().

buildScratchExecCopy()

Definition at line 887 of file SIFrameLowering.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::LiveRegUnits::addReg(), llvm::BuildMI(), DL, findScratchNonCalleeSaveRegister(), llvm::MachineFunction::getInfo(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), initLiveUnits(), MBB, MBBI, MRI, llvm::report_fatal_error(), llvm::MachineOperand::setIsDead(), TII, and TRI.

Referenced by llvm::SIFrameLowering::emitCSRSpillRestores(), and llvm::SIFrameLowering::emitCSRSpillStores().

findScratchNonCalleeSaveRegister()

findUnusedRegister()

frameTriviallyRequiresSP()

getScratchScaleFactor()

getVGPRSpillLaneOrTempRegister()

Query target location for spilling SGPRs IncludeScratchCopy : Also look for free scratch SGPRs.

Definition at line 72 of file SIFrameLowering.cpp.

References llvm::LiveRegUnits::addReg(), llvm::SIMachineFunctionInfo::addToPrologEpilogSGPRSpills(), llvm::SIMachineFunctionInfo::allocateSGPRSpillToVGPRLane(), llvm::dbgs(), findUnusedRegister(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), llvm::SIMachineFunctionInfo::getSGPRSpillToPhysicalVGPRLanes(), llvm::MachineFunction::getSubtarget(), LLVM_DEBUG, llvm::printReg(), llvm::MachineFrameInfo::RemoveStackObject(), llvm::TargetStackID::SGPRSpill, Size, and TRI.

Referenced by llvm::SIFrameLowering::determinePrologEpilogSGPRSaves().

initLiveUnits()

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