LLVM 22.0.0git
|
#include "SIFrameLowering.h"
#include "AMDGPU.h"
#include "AMDGPULaneMaskUtils.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" |
Variables | |
static cl::opt< bool > | EnableSpillVGPRToAGPR ("amdgpu-spill-vgpr-to-agpr", cl::desc("Enable spilling VGPRs to AGPRs"), cl::ReallyHidden, cl::init(true)) |
#define DEBUG_TYPE "frame-info" |
Definition at line 22 of file SIFrameLowering.cpp.
|
static |
Definition at line 1429 of file SIFrameLowering.cpp.
References llvm::SIMachineFunctionInfo::checkIndexInPrologEpilogSGPRSpills(), E(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::MachineFrameInfo::getObjectIndexBegin(), llvm::MachineFrameInfo::getObjectIndexEnd(), llvm::MachineFrameInfo::getStackID(), I, llvm::MachineFrameInfo::isDeadObjectIndex(), and llvm::TargetStackID::SGPRSpill.
Referenced by llvm::SIFrameLowering::processFunctionBeforeFrameFinalized().
|
static |
Definition at line 528 of file SIFrameLowering.cpp.
References E(), llvm::MachineFrameInfo::getObjectIndexBegin(), llvm::MachineFrameInfo::getObjectIndexEnd(), I, and llvm::MachineFrameInfo::isDeadObjectIndex().
Referenced by llvm::SIFrameLowering::determinePrologEpilogSGPRSaves(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), and llvm::SIFrameLowering::processFunctionBeforeFrameFinalized().
|
static |
Definition at line 1830 of file SIFrameLowering.cpp.
References A(), llvm::alignDown(), assert(), B(), BlockSize, llvm::countl_zero(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getInfo(), llvm::CalleeSavedInfo::getReg(), llvm::is_sorted(), llvm::SIMachineFunctionInfo::isWWMReservedRegister(), Reg, llvm::SIMachineFunctionInfo::setMaskForVGPRBlockOps(), and TRI.
Referenced by llvm::SIFrameLowering::assignCalleeSavedSpillSlots().
|
static |
Definition at line 158 of file SIFrameLowering.cpp.
References DL, llvm::MachinePointerInfo::getFixedStack(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getMachineMemOperand(), llvm::MachineFrameInfo::getObjectAlign(), llvm::MachineFrameInfo::getObjectSize(), I, MBB, llvm::MachineMemOperand::MOLoad, Opc, and TRI.
Referenced by llvm::SIFrameLowering::emitCSRSpillRestores().
|
static |
Definition at line 178 of file SIFrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineRegisterInfo::addLiveIn(), llvm::MachineInstrBuilder::addReg(), llvm::BuildMI(), DL, llvm::SIMachineFunctionInfo::getGITPtrHigh(), llvm::SIMachineFunctionInfo::getGITPtrLoReg(), llvm::MachineFunction::getInfo(), llvm::MachineFunction::getRegInfo(), I, llvm::RegState::ImplicitDefine, MBB, TII, and TRI.
|
static |
Definition at line 135 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, MBB, llvm::MachineMemOperand::MOStore, Opc, llvm::LiveRegUnits::removeReg(), and TRI.
Referenced by llvm::SIFrameLowering::emitCSRSpillStores().
|
static |
Definition at line 935 of file SIFrameLowering.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::LiveRegUnits::addReg(), assert(), llvm::BuildMI(), DL, findScratchNonCalleeSaveRegister(), llvm::MachineFunction::getInfo(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), initLiveUnits(), llvm::SIMachineFunctionInfo::isWholeWaveFunction(), MBB, MBBI, MRI, llvm::report_fatal_error(), llvm::MachineOperand::setIsDead(), TII, and TRI.
Referenced by llvm::SIFrameLowering::emitCSRSpillRestores(), and llvm::SIFrameLowering::emitCSRSpillStores().
|
static |
Definition at line 50 of file SIFrameLowering.cpp.
References llvm::LiveRegUnits::addReg(), llvm::LiveRegUnits::available(), findUnusedRegister(), MRI, and Reg.
Referenced by buildScratchExecCopy(), llvm::SIFrameLowering::emitEpilogue(), and llvm::SIFrameLowering::emitPrologue().
|
static |
Definition at line 35 of file SIFrameLowering.cpp.
References llvm::LiveRegUnits::available(), MRI, and Reg.
Referenced by llvm::SIFrameLowering::determinePrologEpilogSGPRSaves(), findScratchNonCalleeSaveRegister(), and getVGPRSpillLaneOrTempRegister().
|
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 2146 of file SIFrameLowering.cpp.
References llvm::MachineFrameInfo::hasPatchPoint(), llvm::MachineFrameInfo::hasStackMap(), and llvm::MachineFrameInfo::hasVarSizedObjects().
Referenced by llvm::SIFrameLowering::hasFPImpl(), and llvm::SIFrameLowering::requiresStackPointerReference().
|
static |
Definition at line 592 of file SIFrameLowering.cpp.
Referenced by llvm::SIFrameLowering::eliminateCallFramePseudoInstr(), llvm::SIFrameLowering::emitEntryFunctionPrologue(), and llvm::SIFrameLowering::emitPrologue().
|
static |
Query target location for spilling SGPRs IncludeScratchCopy
: Also look for free scratch SGPRs.
Definition at line 73 of file SIFrameLowering.cpp.
References llvm::LiveRegUnits::addReg(), llvm::SIMachineFunctionInfo::addToPrologEpilogSGPRSpills(), llvm::SIMachineFunctionInfo::allocateSGPRSpillToVGPRLane(), llvm::COPY_TO_SCRATCH_SGPR, 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, llvm::SPILL_TO_MEM, llvm::SPILL_TO_VGPR_LANE, and TRI.
Referenced by llvm::SIFrameLowering::determinePrologEpilogSGPRSaves().
|
static |
Definition at line 203 of file SIFrameLowering.cpp.
References llvm::LiveRegUnits::addLiveIns(), llvm::LiveRegUnits::addLiveOuts(), llvm::LiveRegUnits::empty(), llvm::LiveRegUnits::init(), MBB, MBBI, llvm::LiveRegUnits::stepBackward(), and TRI.
Referenced by buildScratchExecCopy(), llvm::SIFrameLowering::emitEpilogue(), and llvm::SIFrameLowering::emitPrologue().