LLVM 20.0.0git
|
#include "Target/AMDGPU/GCNSchedStrategy.h"
Public Member Functions | |
virtual bool | initGCNSchedStage () |
virtual void | finalizeGCNSchedStage () |
virtual bool | initGCNRegion () |
void | setupNewBlock () |
void | finalizeGCNRegion () |
void | checkScheduling () |
ScheduleMetrics | getScheduleMetrics (const std::vector< SUnit > &InputSchedule) |
ScheduleMetrics | getScheduleMetrics (const GCNScheduleDAGMILive &DAG) |
unsigned | computeSUnitReadyCycle (const SUnit &SU, unsigned CurrCycle, DenseMap< unsigned, unsigned > &ReadyCycles, const TargetSchedModel &SM) |
virtual bool | shouldRevertScheduling (unsigned WavesAfter) |
bool | isRegionWithExcessRP () const |
unsigned | getRegionIdx () |
bool | mayCauseSpilling (unsigned WavesAfter) |
void | revertScheduling () |
void | advanceRegion () |
virtual | ~GCNSchedStage ()=default |
Protected Member Functions | |
GCNSchedStage (GCNSchedStageID StageID, GCNScheduleDAGMILive &DAG) | |
Protected Attributes | |
GCNScheduleDAGMILive & | DAG |
GCNSchedStrategy & | S |
MachineFunction & | MF |
SIMachineFunctionInfo & | MFI |
const GCNSubtarget & | ST |
const GCNSchedStageID | StageID |
MachineBasicBlock * | CurrentMBB = nullptr |
unsigned | RegionIdx = 0 |
std::vector< MachineInstr * > | Unsched |
GCNRegPressure | PressureBefore |
GCNRegPressure | PressureAfter |
std::vector< std::unique_ptr< ScheduleDAGMutation > > | SavedMutations |
Definition at line 310 of file GCNSchedStrategy.h.
|
protected |
Definition at line 1016 of file GCNSchedStrategy.cpp.
|
virtualdefault |
|
inline |
Definition at line 388 of file GCNSchedStrategy.h.
References RegionIdx.
void GCNSchedStage::checkScheduling | ( | ) |
Definition at line 1252 of file GCNSchedStrategy.cpp.
References DAG, llvm::dbgs(), llvm::GCNSubtarget::getAddressableNumArchVGPRs(), llvm::GCNRegPressure::getAGPRNum(), llvm::GCNSubtarget::getMaxNumSGPRs(), llvm::GCNSubtarget::getMaxNumVGPRs(), llvm::SIMachineFunctionInfo::getMinAllowedOccupancy(), llvm::GCNRegPressure::getOccupancy(), llvm::AMDGPUSubtarget::getOccupancyWithLocalMemSize(), llvm::GCNRegPressure::getSGPRNum(), llvm::GCNSchedStrategy::getTargetOccupancy(), llvm::GCNRegPressure::getVGPRNum(), llvm::GCNSubtarget::hasGFX90AInsts(), llvm::SIMachineFunctionInfo::limitOccupancy(), LLVM_DEBUG, MF, MFI, PressureAfter, PressureBefore, llvm::print(), RegionIdx, llvm::BitVector::reset(), revertScheduling(), S, llvm::GCNSchedStrategy::SGPRCriticalLimit, shouldRevertScheduling(), ST, and llvm::GCNSchedStrategy::VGPRCriticalLimit.
Referenced by finalizeGCNRegion().
unsigned GCNSchedStage::computeSUnitReadyCycle | ( | const SUnit & | SU, |
unsigned | CurrCycle, | ||
DenseMap< unsigned, unsigned > & | ReadyCycles, | ||
const TargetSchedModel & | SM | ||
) |
Definition at line 1330 of file GCNSchedStrategy.cpp.
References D, DAG, DefMI, llvm::ScheduleDAGInstrs::getSUnit(), llvm::Latency, llvm::SUnit::NodeNum, and llvm::SUnit::Preds.
Referenced by getScheduleMetrics().
void GCNSchedStage::finalizeGCNRegion | ( | ) |
Definition at line 1234 of file GCNSchedStrategy.cpp.
References checkScheduling(), DAG, llvm::ScheduleDAGInstrs::exitRegion(), llvm::GCNSchedStrategy::HasHighPressure, llvm::ScheduleDAGMI::Mutations, llvm::ScheduleDAGInstrs::RegionBegin, llvm::ScheduleDAGInstrs::RegionEnd, RegionIdx, S, SavedMutations, StageID, and llvm::UnclusteredHighRPReschedule.
|
virtual |
Reimplemented in llvm::UnclusteredHighRPStage.
Definition at line 1107 of file GCNSchedStrategy.cpp.
References DAG, llvm::dbgs(), llvm::ScheduleDAGMI::finishBlock(), LLVM_DEBUG, and StageID.
Referenced by llvm::UnclusteredHighRPStage::finalizeGCNSchedStage().
|
inline |
Definition at line 380 of file GCNSchedStrategy.h.
References RegionIdx.
ScheduleMetrics GCNSchedStage::getScheduleMetrics | ( | const GCNScheduleDAGMILive & | DAG | ) |
Definition at line 1408 of file GCNSchedStrategy.cpp.
References computeSUnitReadyCycle(), DAG, llvm::dbgs(), llvm::SUnit::getInstr(), llvm::GCNSubtarget::getInstrInfo(), llvm::SIInstrInfo::getSchedModel(), llvm::ScheduleDAGInstrs::getSUnit(), LLVM_DEBUG, MI, printScheduleModel(), llvm::ScheduleMetrics::ScaleFactor, and ST.
ScheduleMetrics GCNSchedStage::getScheduleMetrics | ( | const std::vector< SUnit > & | InputSchedule | ) |
Definition at line 1375 of file GCNSchedStrategy.cpp.
References computeSUnitReadyCycle(), llvm::dbgs(), llvm::GCNSubtarget::getInstrInfo(), llvm::SIInstrInfo::getSchedModel(), LLVM_DEBUG, printScheduleModel(), llvm::ScheduleMetrics::ScaleFactor, and ST.
Referenced by llvm::UnclusteredHighRPStage::shouldRevertScheduling().
|
virtual |
Reimplemented in llvm::UnclusteredHighRPStage, llvm::ClusteredLowOccStage, and llvm::PreRARematStage.
Definition at line 1128 of file GCNSchedStrategy.cpp.
References llvm::ScheduleDAGMI::addMutation(), llvm::ScheduleDAGInstrs::begin(), llvm::createIGroupLPDAGMutation(), CurrentMBB, DAG, llvm::dbgs(), llvm::MachineBasicBlock::end(), llvm::ScheduleDAGInstrs::end(), llvm::ScheduleDAGMILive::enterRegion(), llvm::MachineBasicBlock::getName(), llvm::MachineFunction::getName(), llvm::getRegPressure(), llvm::GCNSchedStrategy::HasHighPressure, I, if(), llvm::ILPInitialSchedule, llvm::AMDGPU::Initial, isRegionWithExcessRP(), llvm::GCNSchedStrategy::KnownExcessRP, LLVM_DEBUG, MF, llvm::ScheduleDAG::MRI, llvm::ScheduleDAGMI::Mutations, llvm::ScheduleDAGInstrs::NumRegionInstrs, llvm::OccInitialSchedule, llvm::AMDGPU::PreRAReentry, PressureBefore, llvm::print(), llvm::printMBBReference(), llvm::ScheduleDAGInstrs::RegionBegin, llvm::ScheduleDAGInstrs::RegionEnd, RegionIdx, S, SavedMutations, setupNewBlock(), StageID, llvm::UnclusteredHighRPReschedule, and Unsched.
Referenced by llvm::UnclusteredHighRPStage::initGCNRegion(), llvm::ClusteredLowOccStage::initGCNRegion(), and llvm::PreRARematStage::initGCNRegion().
|
virtual |
Reimplemented in llvm::UnclusteredHighRPStage, llvm::ClusteredLowOccStage, and llvm::PreRARematStage.
Definition at line 1020 of file GCNSchedStrategy.cpp.
References DAG, llvm::dbgs(), llvm::ScheduleDAGMI::LIS, LLVM_DEBUG, and StageID.
Referenced by llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::ClusteredLowOccStage::initGCNSchedStage(), and llvm::PreRARematStage::initGCNSchedStage().
|
inline |
Definition at line 375 of file GCNSchedStrategy.h.
References DAG, and RegionIdx.
Referenced by initGCNRegion(), mayCauseSpilling(), and llvm::UnclusteredHighRPStage::shouldRevertScheduling().
Definition at line 1536 of file GCNSchedStrategy.cpp.
References llvm::dbgs(), llvm::SIMachineFunctionInfo::getMinWavesPerEU(), isRegionWithExcessRP(), llvm::GCNRegPressure::less(), LLVM_DEBUG, MF, MFI, PressureAfter, and PressureBefore.
Referenced by llvm::OccInitialScheduleStage::shouldRevertScheduling(), llvm::UnclusteredHighRPStage::shouldRevertScheduling(), llvm::ClusteredLowOccStage::shouldRevertScheduling(), llvm::PreRARematStage::shouldRevertScheduling(), llvm::ILPInitialScheduleStage::shouldRevertScheduling(), and llvm::MemoryClauseInitialScheduleStage::shouldRevertScheduling().
void GCNSchedStage::revertScheduling | ( | ) |
Definition at line 1546 of file GCNSchedStrategy.cpp.
References llvm::RegisterOperands::adjustLaneLiveness(), llvm::ScheduleDAGInstrs::BB, llvm::RegisterOperands::collect(), DAG, llvm::dbgs(), llvm::RegisterOperands::detectDeadDefs(), llvm::LiveIntervals::getInstructionIndex(), llvm::GCNSchedStrategy::getNextStage(), llvm::GCNRegPressure::getOccupancy(), llvm::SlotIndex::getRegSlot(), llvm::LiveIntervals::handleMove(), llvm::GCNSchedStrategy::hasNextStage(), llvm::MachineBasicBlock::insert(), llvm::ScheduleDAGMI::LIS, LLVM_DEBUG, MI, llvm::ScheduleDAG::MRI, llvm::ScheduleDAGMI::placeDebugValues(), PressureBefore, llvm::ScheduleDAGInstrs::RegionBegin, llvm::ScheduleDAGInstrs::RegionEnd, RegionIdx, llvm::MachineBasicBlock::remove(), S, llvm::ScheduleDAGMILive::ShouldTrackLaneMasks, ST, llvm::ScheduleDAG::TRI, llvm::UnclusteredHighRPReschedule, and Unsched.
Referenced by checkScheduling().
void GCNSchedStage::setupNewBlock | ( | ) |
Definition at line 1220 of file GCNSchedStrategy.cpp.
References CurrentMBB, DAG, llvm::ScheduleDAGMI::finishBlock(), llvm::ILPInitialSchedule, llvm::MemoryClauseInitialSchedule, llvm::OccInitialSchedule, llvm::ScheduleDAGInstrs::RegionBegin, RegionIdx, StageID, and llvm::ScheduleDAGMI::startBlock().
Referenced by initGCNRegion().
Reimplemented in llvm::OccInitialScheduleStage, llvm::UnclusteredHighRPStage, llvm::ClusteredLowOccStage, llvm::PreRARematStage, llvm::ILPInitialScheduleStage, and llvm::MemoryClauseInitialScheduleStage.
Definition at line 1443 of file GCNSchedStrategy.cpp.
References DAG.
Referenced by checkScheduling(), llvm::OccInitialScheduleStage::shouldRevertScheduling(), llvm::UnclusteredHighRPStage::shouldRevertScheduling(), llvm::ClusteredLowOccStage::shouldRevertScheduling(), and llvm::PreRARematStage::shouldRevertScheduling().
|
protected |
Definition at line 325 of file GCNSchedStrategy.h.
Referenced by initGCNRegion(), and setupNewBlock().
|
protected |
Definition at line 312 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), computeSUnitReadyCycle(), finalizeGCNRegion(), finalizeGCNSchedStage(), llvm::UnclusteredHighRPStage::finalizeGCNSchedStage(), getScheduleMetrics(), initGCNRegion(), llvm::UnclusteredHighRPStage::initGCNRegion(), llvm::ClusteredLowOccStage::initGCNRegion(), llvm::PreRARematStage::initGCNRegion(), initGCNSchedStage(), llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::ClusteredLowOccStage::initGCNSchedStage(), llvm::PreRARematStage::initGCNSchedStage(), isRegionWithExcessRP(), revertScheduling(), setupNewBlock(), shouldRevertScheduling(), and llvm::UnclusteredHighRPStage::shouldRevertScheduling().
|
protected |
Definition at line 316 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), initGCNRegion(), llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::PreRARematStage::initGCNSchedStage(), and mayCauseSpilling().
|
protected |
Definition at line 318 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::PreRARematStage::initGCNSchedStage(), and mayCauseSpilling().
|
protected |
Definition at line 337 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), mayCauseSpilling(), llvm::OccInitialScheduleStage::shouldRevertScheduling(), and llvm::ClusteredLowOccStage::shouldRevertScheduling().
|
protected |
Definition at line 334 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), initGCNRegion(), mayCauseSpilling(), revertScheduling(), llvm::OccInitialScheduleStage::shouldRevertScheduling(), llvm::UnclusteredHighRPStage::shouldRevertScheduling(), and llvm::ClusteredLowOccStage::shouldRevertScheduling().
|
protected |
Definition at line 328 of file GCNSchedStrategy.h.
Referenced by advanceRegion(), checkScheduling(), finalizeGCNRegion(), getRegionIdx(), initGCNRegion(), llvm::UnclusteredHighRPStage::initGCNRegion(), llvm::ClusteredLowOccStage::initGCNRegion(), llvm::PreRARematStage::initGCNRegion(), isRegionWithExcessRP(), revertScheduling(), and setupNewBlock().
|
protected |
Definition at line 314 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), finalizeGCNRegion(), llvm::UnclusteredHighRPStage::finalizeGCNSchedStage(), initGCNRegion(), llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::PreRARematStage::initGCNSchedStage(), revertScheduling(), and llvm::UnclusteredHighRPStage::shouldRevertScheduling().
|
protected |
Definition at line 339 of file GCNSchedStrategy.h.
Referenced by finalizeGCNRegion(), llvm::UnclusteredHighRPStage::finalizeGCNSchedStage(), initGCNRegion(), and llvm::UnclusteredHighRPStage::initGCNSchedStage().
|
protected |
Definition at line 320 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), getScheduleMetrics(), llvm::PreRARematStage::initGCNSchedStage(), revertScheduling(), and llvm::UnclusteredHighRPStage::shouldRevertScheduling().
|
protected |
Definition at line 322 of file GCNSchedStrategy.h.
Referenced by finalizeGCNRegion(), finalizeGCNSchedStage(), llvm::UnclusteredHighRPStage::finalizeGCNSchedStage(), initGCNRegion(), initGCNSchedStage(), and setupNewBlock().
|
protected |
Definition at line 331 of file GCNSchedStrategy.h.
Referenced by initGCNRegion(), and revertScheduling().