23#define DEBUG_TYPE "machine-scheduler"
37 void schedule()
override {}
56 unsigned PkF32,
unsigned Window) {
66 Res.
Pattern =
"undefinedundefinedundefinedundefined";
68 for (
unsigned I = 0;
I < Window; ++
I) {
88 const MAIInstInfo *Info = getMAIInstInfoHelper(Opcode);
157 if (ST.hasGFX950Insts()) {
173 if (
MI.isDebugInstr())
176 unsigned Opc =
MI.getOpcode();
179 if (
Opc == AMDGPU::ATOMIC_FENCE ||
Opc == AMDGPU::S_BARRIER_WAIT ||
203 case AMDGPU::V_PK_ADD_F32:
204 case AMDGPU::V_PK_FMA_F32:
205 case AMDGPU::V_PK_MOV_B32:
206 case AMDGPU::V_PK_MUL_F32:
236 for (
SUnit *PrioritySU : PrioritySUs) {
237 if (!PrioritySU->isTopReady())
244 unsigned MinDepth = std::numeric_limits<unsigned int>::max();
245 SUnit *TargetSU =
nullptr;
246 for (
auto *SU : AllSUs) {
250 if (SU->isTopReady())
253 if (SU->getDepth() < MinDepth) {
254 MinDepth = SU->getDepth();
262 if (!AllSUs.insert(SU))
265 TotalCycles += BlockingCycles;
267 if (PrioritySUs.empty()) {
268 PrioritySUs.insert(SU);
272 unsigned CurrDepth = (*PrioritySUs.begin())->getDepth();
273 if (SUDepth > CurrDepth)
276 if (SUDepth == CurrDepth) {
277 PrioritySUs.insert(SU);
283 PrioritySUs.insert(SU);
290 if (TotalCycles == 0)
293 ScheduledSUs.push_back(SU);
295 PrioritySUs.remove(SU);
299 if (BufferSize <= 1 || (ScheduledSUs.size() % BufferSize == 0))
300 TotalCycles -= std::min(TotalCycles, BlockingCycles);
304 if (PrioritySUs.empty()) {
305 for (
auto SU : AllSUs) {
306 if (PrioritySUs.empty()) {
307 PrioritySUs.insert(SU);
311 unsigned CurrDepth = (*PrioritySUs.begin())->getDepth();
312 if (SUDepth > CurrDepth)
315 if (SUDepth == CurrDepth) {
316 PrioritySUs.insert(SU);
322 PrioritySUs.insert(SU);
328 if (BufferSize == 0 || AllSUs.empty())
333 BufferCycles =
static_cast<unsigned>(TotalCycles / AllSUs.size());
350 TotalCycles /= BufferSize;
356 if (HWUICand.getType() == Flavor) {
365 unsigned ReleaseAtCycle = 0;
370 std::max(ReleaseAtCycle,
static_cast<unsigned>(PI->ReleaseAtCycle));
372 ReleaseAtCycle = std::max(ReleaseAtCycle,
SII->getBlockingCycles(*
MI));
373 return ReleaseAtCycle;
378 if (
MI->mayLoadOrStore())
404 for (
unsigned I = 0;
I <
HWUInfo.size();
I++) {
412 .setProducesCoexecWindow(
true);
432 for (
auto PredMBB :
MBB->predecessors()) {
433 auto I = PredMBB->rbegin();
434 auto E = PredMBB->rend();
435 for (;
I != E;
I++) {
451 auto Reg =
Op.getReg();
452 if (!Reg.isVirtual())
465 if (
Def.getParent() !=
MI->getParent()) {
466 bool FoundUseInDefBlock =
false;
468 if (
Use.getParent() !=
Def.getParent())
477 FoundUseInDefBlock =
true;
481 if (!FoundUseInDefBlock)
518 auto mustHaveDSAfter = [
this]() {
519 if (!
DAG->SUnits.size())
529 for (
auto &SU :
DAG->SUnits) {
538 bool MustHaveDSAfter = RegionWMMAs.
size();
540 for (
SUnit *SU : RegionWMMAs) {
541 bool HasDSSucc =
false;
542 for (
auto &Succ : SU->Succs) {
543 if (!Succ.getSUnit()->getInstr())
553 MustHaveDSAfter =
false;
558 return MustHaveDSAfter;
561 std::optional<CarriedLatency> BlockCarriedLatency =
562 DAG->MF.getSubtarget<
GCNSubtarget>().getCLOpts().block_carried_latency;
567 for (
auto &SU :
DAG->SUnits) {
577 HWUI.finalizeCycles();
585 <<
" (" <<
DAG->SUnits.size() <<
" SUs) ===\n";
587 dbgs() <<
"\nHWUI Resource Pressure:\n";
589 if (HWUI.getTotalCycles() == 0)
593 dbgs() <<
" " << Name <<
": " << HWUI.getTotalCycles() <<
" cycles, "
594 << HWUI.size() <<
" instrs\n";
603 if (
A.producesCoexecWindow() !=
B.producesCoexecWindow())
604 return A.producesCoexecWindow();
607 if (
A.getTotalCycles() !=
B.getTotalCycles())
608 return A.getTotalCycles() >
B.getTotalCycles();
611 if (
A.size() !=
B.size())
612 return A.size() <
B.size();
615 return static_cast<unsigned>(
A.getType()) <
616 static_cast<unsigned>(
B.getType());
622 assert(Zone.
isTop() &&
"effective stall comparison requires top boundary");
640 if (NextAvail > CurrCycle)
641 Stall = std::max(
Stall, NextAvail - CurrCycle);
659 auto getBufferFullStalls = [
this, &Zone](
SUnit *SU) ->
unsigned {
670 if (BufferReadyCycle <= CurrCycle)
673 return BufferReadyCycle - CurrCycle;
678 auto getFenceStalls = [
this, &CurrCycle](
SUnit *SU) ->
unsigned {
693 unsigned LastConsumerCycle = LastConsumer ? LastConsumer->
TopReadyCycle : 0;
696 if (LastProducerCycle < LastConsumerCycle)
699 unsigned FenceStallFinish =
701 return FenceStallFinish <= CurrCycle ? 0 : FenceStallFinish - CurrCycle;
706 Costs.
Ready = ReadyCycle > CurrCycle ? ReadyCycle - CurrCycle : 0;
711 Costs.
Buffer = getBufferFullStalls(SU);
712 Costs.
Fence = getFenceStalls(SU);
729 dbgs() <<
"Effective stalls: try=" << TryCosts.Effective
730 <<
" (ready=" << TryCosts.Ready <<
", struct=" << TryCosts.Structural
731 <<
", lat=" << TryCosts.Latency <<
", carried=" << TryCosts.Carried
732 <<
", buffer=" << TryCosts.Buffer <<
", fence=" << TryCosts.Fence
733 <<
") cand=" << CandCosts.Effective <<
" (ready=" << CandCosts.Ready
734 <<
", struct=" << CandCosts.Structural
735 <<
", lat=" << CandCosts.Latency <<
", carried=" << CandCosts.Carried
736 <<
", buffer=" << CandCosts.Buffer <<
", fence=" << CandCosts.Fence
757 if (!(TryIsMemoryPipeline || CandIsMemoryPipeline))
760 if (TryIsMemoryPipeline)
763 if (CandIsMemoryPipeline)
766 if (TryIsMemoryPipeline == CandIsMemoryPipeline)
769 if (CandIsMemoryPipeline) {
784 auto HasPrioritySU = [
this, &Cand, &TryCand](
unsigned ResourceIdx) {
801 auto TryEnablesResource = [&Cand, &TryCand,
this](
unsigned ResourceIdx) {
811 TargetSU != Cand.
SU &&
DAG->IsReachable(TargetSU, Cand.
SU);
812 bool TryCandEnables =
813 TargetSU != TryCand.
SU &&
DAG->IsReachable(TargetSU, TryCand.
SU);
815 if (!CandEnables && !TryCandEnables)
818 if (CandEnables && !TryCandEnables) {
825 if (!CandEnables && TryCandEnables) {
834 if (CandHeight > TryCandHeight) {
841 if (CandHeight < TryCandHeight) {
853 for (
unsigned I = 0;
I <
HWUInfo.size();
I++) {
856 if (!HasPrioritySU(
I))
859 bool Enabled = TryEnablesResource(
I);
870 for (
unsigned I = 0;
I <
HWUInfo.size();
I++) {
874 bool TryCandUsesCrit = HWUI.
contains(TryCand.
SU);
876 if (!CandUsesCrit && !TryCandUsesCrit)
879 if (CandUsesCrit != TryCandUsesCrit) {
900 if (Match == Cand.
SU) {
953 Top.HazardRec = std::make_unique<GCNHazardRecognizer>(
958 Heurs.updateForScheduling(SU);
964 "coexec scheduler only supports top-down scheduling");
966 if (
DAG->top() ==
DAG->bottom()) {
968 Bot.Available.empty() &&
Bot.Pending.empty() &&
"ReadyQ garbage");
972 bool PickedPending =
false;
978 PickedPending =
false;
984 PickedPending,
false);
998 unsigned CurrentCycle =
Top.getCurrCycle();
999 if (ReadyCycle > CurrentCycle)
1000 Top.bumpCycle(ReadyCycle);
1003 while (
Top.checkHazard(SU))
1004 Top.bumpCycle(
Top.getCurrCycle() + 1);
1006 Top.releasePending();
1010 Top.removeReady(SU);
1012 Bot.removeReady(SU);
1016 assert(IsTopNode &&
"coexec scheduler must only schedule from top boundary");
1023 bool &PickedPending,
bool IsBottomUp) {
1024 assert(Zone.
isTop() &&
"coexec scheduler only supports top boundary");
1025 assert(!IsBottomUp &&
"coexec scheduler only supports top-down scheduling");
1029 unsigned SGPRPressure = 0;
1030 unsigned VGPRPressure = 0;
1031 unsigned AGPRPressure = 0;
1032 PickedPending =
false;
1033 if (
DAG->isTrackingPressure()) {
1035 SGPRPressure =
Pressure[AMDGPU::RegisterPressureSets::SReg_32];
1036 VGPRPressure =
Pressure[AMDGPU::RegisterPressureSets::VGPR_32];
1037 AGPRPressure =
Pressure[AMDGPU::RegisterPressureSets::AGPR_32];
1040 std::tie(VGPRPressure, AGPRPressure) =
1045 auto EvaluateQueue = [&](
ReadyQueue &Q,
bool FromPending) {
1046 for (
SUnit *SU : Q) {
1049 VGPRPressure, AGPRPressure, IsBottomUp);
1056 PickedPending = FromPending;
1068 EvaluateQueue(Zone.
Pending,
true);
1075 unsigned Cycle = IsTopNode ?
Top.getCurrCycle() :
Bot.getCurrCycle();
1077 dbgs() <<
"=== Pick @ Cycle " << Cycle <<
" ===\n";
1080 dbgs() <<
"Picked: " << *SU <<
" ";
1085 dbgs() <<
" Reason: ";
1091 dbgs() <<
"Unknown";
1113 if (
DAG->isTrackingPressure() &&
1123 bool SameBoundary = Zone !=
nullptr;
1127 if (
Heurs.tryEffectiveStall(TryCand, Cand, *Zone)) {
1132 if (
Heurs.tryMemoryPipeline(TryCand, Cand, *Zone)) {
1137 Heurs.sortHWUIResources();
1138 if (
Heurs.tryCriticalResource(TryCand, Cand, Zone)) {
1143 if (
Heurs.tryCriticalResourceDependency(TryCand, Cand, Zone)) {
1157 bool CandIsClusterSucc =
1159 bool TryCandIsClusterSucc =
1162 if (
tryGreater(TryCandIsClusterSucc, CandIsClusterSucc, TryCand, Cand,
1174 if (
DAG->isTrackingPressure() &&
1183 !
Rem.IsAcyclicLatencyLimited &&
tryLatency(TryCand, Cand, *Zone))
1199 LLVM_DEBUG(
dbgs() <<
"AMDGPU coexec preRA scheduler selected for "
1200 <<
C->MF->getName() <<
'\n');
1202 C, std::make_unique<AMDGPUCoExecSchedStrategy>(
C));
1211 <<
C->MF->getName() <<
'\n');
1212 return new GCNNoopPostScheduleDAG(
C);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static SUnit * pickOnlyChoice(SchedBoundary &Zone)
static CoExecInfo buildMFMACoExecInfo(unsigned SALU, unsigned Mem, unsigned VALU, unsigned MFMA, unsigned PkF32, unsigned Window)
Build MFMA co-exec rules from the first stage at which SALU, memory (DS and VMEM),...
static constexpr unsigned DefaultCoExecVGPRThresholdPercent
Coexecution-focused scheduling strategy for AMDGPU.
AMDGPU Rewrite AGPR Copy MFMA
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Register const TargetRegisterInfo * TRI
AMDGPU::AMDGPUSchedReason LastAMDGPUReason
void initPolicy(MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs) override
Optionally override the per-region scheduling policy.
CandidateHeuristics Heurs
SUnit * pickNode(bool &IsTopNode) override
Pick the next node to schedule, or return NULL.
void pickNodeFromQueue(SchedBoundary &Zone, const CandPolicy &ZonePolicy, const RegPressureTracker &RPTracker, SchedCandidate &Cand, bool &PickedPending, bool IsBottomUp)
void initialize(ScheduleDAGMI *DAG) override
Initialize the strategy after building the DAG for a new region.
void schedNode(SUnit *SU, bool IsTopNode) override
Notify MachineSchedStrategy that ScheduleDAGMI has scheduled an instruction and updated scheduled/rem...
AMDGPUCoExecSchedStrategy(const MachineSchedContext *C)
void dumpPickSummary(SUnit *SU, bool IsTopNode, SchedCandidate &Cand)
bool tryCandidateCoexec(SchedCandidate &Cand, SchedCandidate &TryCand, SchedBoundary *Zone)
Represent a constant reference to an array (0 or more elements consecutively in memory),...
void updateForScheduling(SUnit *SU)
Update the state to reflect that SU is going to be scheduled.
unsigned getCarriedLatency(SUnit *SU)
Estimate the block carried latency from loads for a given SU.
HardwareUnitInfo * getHWUIFromFlavor(AMDGPU::InstructionFlavor Flavor)
Given a Flavor , find the corresponding HardwareUnit.
DenseMap< MachineInstr *, unsigned > CarriedLatencies
StallCosts getStallCosts(SUnit *SU, SchedBoundary &Zone)
void initialize(ScheduleDAGMI *DAG, const TargetSchedModel *SchedModel, const TargetRegisterInfo *TRI, const MachineLoopInfo *MLI)
void sortHWUIResources()
Sort the HardwarUnitInfo vector.
void collectRegionSummary()
Walk over the region and collect characteristics for the various heuristics.
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.
bool tryEffectiveStall(GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, SchedBoundary &Zone)
AMDGPU::CarriedLatency RegionCarriedLatency
unsigned getHWUICyclesForMI(MachineInstr *MI)
Compute the blocking cycles for the appropriate HardwareUnit given an MI.
SmallVector< HardwareUnitInfo, 8 > HWUInfo
const SIRegisterInfo * SRI
const TargetSchedModel * SchedModel
unsigned getMaxBlockingCycles(const MCSchedClassDesc *SC, const MachineInstr *MI)
const MachineLoopInfo * MLI
bool tryMemoryPipeline(GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, SchedBoundary &Zone)
Prioritize instructions involved the memory pipeline.
unsigned getStructuralStallCycles(SchedBoundary &Zone, SUnit *SU)
bool useGCNTrackers() const
GCNSchedStrategy(const MachineSchedContext *C)
SmallVector< GCNSchedStageID, 4 > SchedStages
unsigned VGPRThresholdPercent
std::pair< unsigned, unsigned > getBankedPressure(const GCNRegPressure &RP) const
void schedNode(SUnit *SU, bool IsTopNode) override
Notify MachineSchedStrategy that ScheduleDAGMI has scheduled an instruction and updated scheduled/rem...
std::vector< unsigned > Pressure
void initialize(ScheduleDAGMI *DAG) override
Initialize the strategy after building the DAG for a new region.
void printCandidateDecision(const SchedCandidate &Current, const SchedCandidate &Preferred)
GCNManualDownwardRPTracker DownwardTracker
void initCandidate(SchedCandidate &Cand, SUnit *SU, bool AtTop, const RegPressureTracker &RPTracker, const SIRegisterInfo *SRI, unsigned SGPRPressure, unsigned VGPRPressure, unsigned AGPRPressure, bool IsBottomUp)
MachineSchedPolicy RegionPolicy
const TargetSchedModel * SchedModel
static const char * getReasonStr(GenericSchedulerBase::CandReason Reason)
const TargetRegisterInfo * TRI
SchedCandidate TopCand
Candidate last picked from Top boundary.
HardwareUnitInfo is a wrapper class which maps to some real hardware resource.
void markScheduled(SUnit *SU, unsigned BlockingCycles)
Update the state for SU being scheduled by removing it from the AllSUs and reducing its BlockingCycle...
bool contains(SUnit *SU) const
SUnit * getNextTargetSU(bool LookDeep=false) const
void insert(SUnit *SU, unsigned BlockingCycles)
Insert the SU into AllSUs and account its BlockingCycles into the TotalCycles.
void finalizeCycles()
After we've collected all the region pressure for this HWUI, correct for any specifics of the behavio...
AMDGPU::InstructionFlavor getType() const
SUnit * getLastScheduledSU()
unsigned getBufferAvailableCycle(unsigned CurrCycle)
SUnit * getHigherPriority(SUnit *SU, SUnit *Other) const
unsigned getNumBlocks() const
Get the number of blocks in this loop in constant time.
Represents a single loop in the control flow graph.
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
LLVM_ABI void print(raw_ostream &OS, bool IsStandalone=true, bool SkipOpers=false, bool SkipDebugLoc=false, bool AddNewLine=true, const TargetInstrInfo *TII=nullptr) const
Print this MI to OS.
MachineOperand class - Representation of each machine instruction operand.
virtual void initPolicy(MachineBasicBlock::iterator Begin, MachineBasicBlock::iterator End, unsigned NumRegionInstrs)
Optionally override the per-region scheduling policy.
Helpers for implementing custom MachineSchedStrategy classes.
Track the current register pressure at some position in the instruction stream, and remember the high...
const std::vector< unsigned > & getRegSetPressureAtPos() const
Get the register set pressure at the current position, which may be less than the pressure across the...
static bool isDS(const MachineInstr &MI)
static bool isVMEM(const MachineInstr &MI)
static bool isSMRD(const MachineInstr &MI)
static bool isSALU(const MachineInstr &MI)
static bool isSWMMAC(const MachineInstr &MI)
const GCNSubtarget & getSubtarget() const
unsigned getBlockingCycles(const MachineInstr &MI) const
static bool isVALU(const MachineInstr &MI, bool AllowLDSDMA)
static bool isTRANS(const MachineInstr &MI)
static bool isWaitcnt(unsigned Opcode)
static bool isMFMA(const MachineInstr &MI)
static bool isWMMA(const MachineInstr &MI)
static bool isLDSDMA(const MachineInstr &MI)
Scheduling unit. This is a node in the scheduling DAG.
unsigned TopReadyCycle
Cycle relative to start when node is ready.
unsigned NodeNum
Entry # of node in the node vector.
unsigned getHeight() const
Returns the height of this node, which is the length of the maximum path down to any node which has n...
unsigned getDepth() const
Returns the depth of this node, which is the length of the maximum path up to any node which has no p...
bool isScheduled
True once scheduled.
unsigned ParentClusterIdx
The parent cluster id.
bool hasReservedResource
Uses a reserved resource.
bool isBottomReady() const
MachineInstr * getInstr() const
Returns the representative MachineInstr for this SUnit.
Each Scheduling boundary is associated with ready queues.
LLVM_ABI unsigned getLatencyStallCycles(SUnit *SU)
Get the difference between the given SUnit's ready time and the current cycle.
LLVM_ABI SUnit * pickOnlyChoice()
Call this before applying any other heuristics to the Available queue.
unsigned getCurrCycle() const
Number of cycles to issue the instructions scheduled in this zone.
std::unique_ptr< ScheduleHazardRecognizer > HazardRec
LLVM_ABI std::pair< unsigned, unsigned > getNextResourceCycle(const MCSchedClassDesc *SC, unsigned PIdx, unsigned ReleaseAtCycle, unsigned AcquireAtCycle)
Compute the next cycle at which the given processor resource can be scheduled.
A ScheduleDAG for scheduling lists of MachineInstr.
ScheduleDAGMILive is an implementation of ScheduleDAGInstrs that schedules machine instructions while...
ScheduleDAGMI is an implementation of ScheduleDAGInstrs that simply schedules machine instructions ac...
void addMutation(std::unique_ptr< ScheduleDAGMutation > Mutation)
Add a postprocessing step to the DAG builder.
SlotIndex - An opaque wrapper around machine indexes.
static bool isEarlierInstr(SlotIndex A, SlotIndex B)
isEarlierInstr - Return true if A refers to an instruction earlier than B.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Provide an instruction scheduling machine model to CodeGen passes.
const MCWriteProcResEntry * ProcResIter
A Use represents the edge between a Value definition and its users.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
InstructionFlavor
Classification of instructions by execution characteristics.
constexpr unsigned MaxCoExecStages
Max stages: INT8 16x16x64 = 17 cycles, round up for safety.
CoExecInfo getMFMACoExecInfo(unsigned Opcode, const GCNSubtarget &ST)
Get co-execution info for a gfx942 or gfx950 MFMA instruction.
InstructionFlavor classifyFlavor(const MachineInstr &MI, const SIInstrInfo &SII)
Classify MI into the execution flavor that drives both the scheduler's slot preferences and the hazar...
StringRef getReasonName(AMDGPUSchedReason R)
MFMAVariant
Normalized MFMA or SMFMAC family, selects co-execution rules.
StringRef getFlavorName(InstructionFlavor F)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI int biasPhysReg(const SUnit *SU, bool isTop, bool BiasPRegsExtra=false)
Minimize physical register live ranges.
std::unique_ptr< ScheduleDAGMutation > createAMDGPUBarrierLatencyDAGMutation(MachineFunction *MF)
LLVM_ABI unsigned getWeakLeft(const SUnit *SU, bool isTop)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
std::unique_ptr< ScheduleDAGMutation > createIGroupLPDAGMutation(AMDGPU::SchedulingPhase Phase)
Phase specifes whether or not this is a reentry into the IGroupLPDAGMutation.
LLVM_ABI bool tryPressure(const PressureChange &TryP, const PressureChange &CandP, GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, GenericSchedulerBase::CandReason Reason, const TargetRegisterInfo *TRI, const MachineFunction &MF)
@ LiveIntervalRPReschedule
void sort(IteratorTy Start, IteratorTy End)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
cl::opt< unsigned, false, VGPRThresholdParser > VGPRThresholdPercentOpt
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
ScheduleDAGInstrs * createGCNNoopPostMachineScheduler(MachineSchedContext *C)
LLVM_ABI bool tryLatency(GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, SchedBoundary &Zone)
LLVM_ABI MISched::Direction getPreRADirection(const MachineFunction &MF)
Returns -misched-prera-direction.
ScheduleDAGInstrs * createGCNCoExecMachineScheduler(MachineSchedContext *C)
bool isTheSameCluster(unsigned A, unsigned B)
Return whether the input cluster ID's are the same and valid.
DWARFExpression::Operation Op
LLVM_ABI bool tryGreater(int TryVal, int CandVal, GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, GenericSchedulerBase::CandReason Reason)
LLVM_ABI bool tryLess(int TryVal, int CandVal, GenericSchedulerBase::SchedCandidate &TryCand, GenericSchedulerBase::SchedCandidate &Cand, GenericSchedulerBase::CandReason Reason)
Return true if this heuristic determines order.
@ Enabled
Convert any .debug_str_offsets tables to DWARF64 if needed.
@ End
Run the machine verifier once, at the end of the pipeline.
Co-execution characteristics for a multi-cycle instruction.
unsigned TotalWindow
Number of cycles in the co-execution window, counting any trailing vacant stages.
StringRef Pattern
Pattern string for display (e.g., "0EIIEEIIV").
static CoExecInfo build(unsigned UnitOccupancy, unsigned TotalWindow, const char *Pattern)
Build a CoExecInfo from an occupancy and stage pattern.
CoExecSlotInfo Slots[MaxCoExecStages]
Per-stage slot info (capability mask).
Policy for scheduling the next instruction in the candidate's zone.
Store the state used by GenericScheduler heuristics, required for the lifetime of one invocation of p...
void setBest(SchedCandidate &Best)
LLVM_ABI void initResourceDelta(const ScheduleDAGMI *DAG, const TargetSchedModel *SchedModel)
SchedResourceDelta ResDelta
Status of an instruction's critical resource consumption.
Summarize the scheduling resources required for an instruction of a particular scheduling class.
Identify one of the processor resource kinds consumed by a particular scheduling class for the specif...
MachineSchedContext provides enough context from the MachineScheduler pass for the target to instanti...
PressureChange CurrentMax