|
LLVM 24.0.0git
|
CandidateHeuristics contains state and implementations to facilitate making per instruction scheduling decisions; it contains methods used in tryCandidate to decide which instruction to schedule next. More...
#include "Target/AMDGPU/AMDGPUCoExecSchedStrategy.h"
Public Member Functions | |
| CandidateHeuristics ()=default | |
| void | initialize (ScheduleDAGMI *DAG, const TargetSchedModel *SchedModel, const TargetRegisterInfo *TRI) |
| void | updateForScheduling (SUnit *SU) |
Update the state to reflect that SU is going to be scheduled. | |
| void | sortHWUIResources () |
| Sort the HWUInfo vector. | |
| bool | tryCriticalResource (GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, SchedBoundary *Zone) const |
| Check for critical resource consumption. | |
| bool | tryCriticalResourceDependency (GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, SchedBoundary *Zone) const |
| Check for dependencies of instructions that use prioritized HardwareUnits. | |
| void | dumpRegionSummary () |
Protected Member Functions | |
| void | collectHWUIPressure () |
| Walk over the region and collect total usage per HardwareUnit. | |
| unsigned | getHWUICyclesForInst (SUnit *SU) |
Compute the blocking cycles for the appropriate HardwareUnit given an SU. | |
| HardwareUnitInfo * | getHWUIFromFlavor (AMDGPU::InstructionFlavor Flavor) |
Given a Flavor , find the corresponding HardwareUnit. | |
Protected Attributes | |
| ScheduleDAGMI * | DAG |
| const SIInstrInfo * | SII |
| const SIRegisterInfo * | SRI |
| const TargetSchedModel * | SchedModel |
| SmallVector< HardwareUnitInfo, 8 > | HWUInfo |
CandidateHeuristics contains state and implementations to facilitate making per instruction scheduling decisions; it contains methods used in tryCandidate to decide which instruction to schedule next.
Definition at line 148 of file AMDGPUCoExecSchedStrategy.h.
|
default |
References DAG, SchedModel, and TRI.
|
protected |
Walk over the region and collect total usage per HardwareUnit.
Definition at line 228 of file AMDGPUCoExecSchedStrategy.cpp.
References llvm::AMDGPU::classifyFlavor(), DAG, dumpRegionSummary(), getHWUICyclesForInst(), HWUInfo, LLVM_DEBUG, SchedModel, and SII.
Referenced by initialize().
| void CandidateHeuristics::dumpRegionSummary | ( | ) |
Definition at line 240 of file AMDGPUCoExecSchedStrategy.cpp.
References DAG, llvm::dbgs(), llvm::AMDGPU::getFlavorName(), llvm::MachineBasicBlock::getNumber(), and HWUInfo.
Referenced by collectHWUIPressure().
Compute the blocking cycles for the appropriate HardwareUnit given an SU.
Definition at line 185 of file AMDGPUCoExecSchedStrategy.cpp.
References assert(), DAG, and SchedModel.
Referenced by collectHWUIPressure(), and updateForScheduling().
|
protected |
Given a Flavor , find the corresponding HardwareUnit.
Definition at line 176 of file AMDGPUCoExecSchedStrategy.cpp.
References HWUInfo.
Referenced by updateForScheduling().
| void CandidateHeuristics::initialize | ( | ScheduleDAGMI * | DAG, |
| const TargetSchedModel * | SchedModel, | ||
| const TargetRegisterInfo * | TRI ) |
Definition at line 204 of file AMDGPUCoExecSchedStrategy.cpp.
References assert(), collectHWUIPressure(), DAG, HWUInfo, I, llvm::AMDGPU::MultiCycleVALU, llvm::AMDGPU::NUM_FLAVORS, SchedModel, SII, SRI, llvm::AMDGPU::TRANS, TRI, and llvm::AMDGPU::WMMA.
| void CandidateHeuristics::sortHWUIResources | ( | ) |
Sort the HWUInfo vector.
After sorting, the HardwareUnits that are highest priority are first. Priority is determined by maximizing coexecution and keeping the critical HardwareUnit busy.
Definition at line 257 of file AMDGPUCoExecSchedStrategy.cpp.
References A(), B(), HWUInfo, and llvm::sort().
| bool CandidateHeuristics::tryCriticalResource | ( | GenericSchedulerBase::SchedCandidate & | TryCand, |
| GenericSchedulerBase::SchedCandidate & | Cand, | ||
| SchedBoundary * | Zone ) const |
Check for critical resource consumption.
Prefer the candidate that uses the most prioritized HardwareUnit. If both candidates use the same HarwareUnit, prefer the candidate with higher priority on that HardwareUnit.
Definition at line 365 of file AMDGPUCoExecSchedStrategy.cpp.
References llvm::HardwareUnitInfo::contains(), llvm::AMDGPU::DS, llvm::HardwareUnitInfo::getHigherPriority(), llvm::HardwareUnitInfo::getType(), HWUInfo, I, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::RegCritical, llvm::GenericSchedulerBase::SchedCandidate::SU, and tryCriticalResourceDependency().
| bool CandidateHeuristics::tryCriticalResourceDependency | ( | GenericSchedulerBase::SchedCandidate & | TryCand, |
| GenericSchedulerBase::SchedCandidate & | Cand, | ||
| SchedBoundary * | Zone ) const |
Check for dependencies of instructions that use prioritized HardwareUnits.
Prefer the candidate that is a dependency of an instruction that uses the most prioritized HardwareUnit. If both candidates enable the same HardwareUnit, prefer the candidate that enables the higher priority instruction on that HardwareUnit.
Definition at line 278 of file AMDGPUCoExecSchedStrategy.cpp.
References llvm::AMDGPU::classifyFlavor(), DAG, llvm::AMDGPU::DS, llvm::Enabled, llvm::SUnit::getHeight(), llvm::SUnit::getInstr(), llvm::HardwareUnitInfo::getNextTargetSU(), llvm::HardwareUnitInfo::getType(), HWUInfo, I, llvm::GenericSchedulerBase::SchedCandidate::Reason, llvm::GenericSchedulerBase::RegCritical, SII, llvm::GenericSchedulerBase::SchedCandidate::SU, and llvm::AMDGPU::WMMA.
Referenced by tryCriticalResource().
| void CandidateHeuristics::updateForScheduling | ( | SUnit * | SU | ) |
Update the state to reflect that SU is going to be scheduled.
Definition at line 197 of file AMDGPUCoExecSchedStrategy.cpp.
References assert(), llvm::AMDGPU::classifyFlavor(), getHWUICyclesForInst(), getHWUIFromFlavor(), llvm::SUnit::getInstr(), llvm::HardwareUnitInfo::markScheduled(), and SII.
|
protected |
Definition at line 150 of file AMDGPUCoExecSchedStrategy.h.
Referenced by CandidateHeuristics(), collectHWUIPressure(), dumpRegionSummary(), getHWUICyclesForInst(), initialize(), and tryCriticalResourceDependency().
|
protected |
Definition at line 154 of file AMDGPUCoExecSchedStrategy.h.
Referenced by collectHWUIPressure(), dumpRegionSummary(), getHWUIFromFlavor(), initialize(), sortHWUIResources(), tryCriticalResource(), and tryCriticalResourceDependency().
|
protected |
Definition at line 153 of file AMDGPUCoExecSchedStrategy.h.
Referenced by CandidateHeuristics(), collectHWUIPressure(), getHWUICyclesForInst(), and initialize().
|
protected |
Definition at line 151 of file AMDGPUCoExecSchedStrategy.h.
Referenced by collectHWUIPressure(), initialize(), tryCriticalResourceDependency(), and updateForScheduling().
|
protected |
Definition at line 152 of file AMDGPUCoExecSchedStrategy.h.
Referenced by initialize().