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 |
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 245 of file GCNSchedStrategy.h.
|
protected |
Definition at line 780 of file GCNSchedStrategy.cpp.
|
virtualdefault |
|
inline |
Definition at line 320 of file GCNSchedStrategy.h.
References RegionIdx.
void GCNSchedStage::checkScheduling | ( | ) |
Definition at line 1015 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 1092 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 997 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 871 of file GCNSchedStrategy.cpp.
References DAG, llvm::dbgs(), llvm::ScheduleDAGMI::finishBlock(), LLVM_DEBUG, and StageID.
Referenced by llvm::UnclusteredHighRPStage::finalizeGCNSchedStage().
ScheduleMetrics GCNSchedStage::getScheduleMetrics | ( | const GCNScheduleDAGMILive & | DAG | ) |
Definition at line 1170 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 1137 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 892 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 784 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 310 of file GCNSchedStrategy.h.
References DAG, and RegionIdx.
Referenced by initGCNRegion(), mayCauseSpilling(), and llvm::UnclusteredHighRPStage::shouldRevertScheduling().
Definition at line 1293 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(), and llvm::ILPInitialScheduleStage::shouldRevertScheduling().
void GCNSchedStage::revertScheduling | ( | ) |
Definition at line 1303 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 984 of file GCNSchedStrategy.cpp.
References CurrentMBB, DAG, llvm::ScheduleDAGMI::finishBlock(), llvm::ILPInitialSchedule, llvm::OccInitialSchedule, llvm::ScheduleDAGInstrs::RegionBegin, RegionIdx, StageID, and llvm::ScheduleDAGMI::startBlock().
Referenced by initGCNRegion().
Reimplemented in llvm::OccInitialScheduleStage, llvm::UnclusteredHighRPStage, llvm::ClusteredLowOccStage, llvm::PreRARematStage, and llvm::ILPInitialScheduleStage.
Definition at line 1205 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 260 of file GCNSchedStrategy.h.
Referenced by initGCNRegion(), and setupNewBlock().
|
protected |
Definition at line 247 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 251 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), initGCNRegion(), llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::PreRARematStage::initGCNSchedStage(), and mayCauseSpilling().
|
protected |
Definition at line 253 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), llvm::UnclusteredHighRPStage::initGCNSchedStage(), llvm::PreRARematStage::initGCNSchedStage(), and mayCauseSpilling().
|
protected |
Definition at line 272 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), mayCauseSpilling(), llvm::OccInitialScheduleStage::shouldRevertScheduling(), and llvm::ClusteredLowOccStage::shouldRevertScheduling().
|
protected |
Definition at line 269 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), initGCNRegion(), mayCauseSpilling(), revertScheduling(), llvm::OccInitialScheduleStage::shouldRevertScheduling(), llvm::UnclusteredHighRPStage::shouldRevertScheduling(), and llvm::ClusteredLowOccStage::shouldRevertScheduling().
|
protected |
Definition at line 263 of file GCNSchedStrategy.h.
Referenced by advanceRegion(), checkScheduling(), finalizeGCNRegion(), initGCNRegion(), llvm::UnclusteredHighRPStage::initGCNRegion(), llvm::ClusteredLowOccStage::initGCNRegion(), llvm::PreRARematStage::initGCNRegion(), isRegionWithExcessRP(), revertScheduling(), and setupNewBlock().
|
protected |
Definition at line 249 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 274 of file GCNSchedStrategy.h.
Referenced by finalizeGCNRegion(), llvm::UnclusteredHighRPStage::finalizeGCNSchedStage(), initGCNRegion(), and llvm::UnclusteredHighRPStage::initGCNSchedStage().
|
protected |
Definition at line 255 of file GCNSchedStrategy.h.
Referenced by checkScheduling(), getScheduleMetrics(), llvm::PreRARematStage::initGCNSchedStage(), revertScheduling(), and llvm::UnclusteredHighRPStage::shouldRevertScheduling().
|
protected |
Definition at line 257 of file GCNSchedStrategy.h.
Referenced by finalizeGCNRegion(), finalizeGCNSchedStage(), llvm::UnclusteredHighRPStage::finalizeGCNSchedStage(), initGCNRegion(), initGCNSchedStage(), and setupNewBlock().
|
protected |
Definition at line 266 of file GCNSchedStrategy.h.
Referenced by initGCNRegion(), and revertScheduling().