@@ -280,39 +280,6 @@ void GCNHazardRecognizer::processBundle() {
280
280
CurrCycleInstr = nullptr ;
281
281
}
282
282
283
- void GCNHazardRecognizer::processBundleBottomUp () {
284
- // Walk through the instructions in this bundle in bottom-up order.
285
- // We only use this during post-RA scheduling, so hazard recognizer mode
286
- // should never be active here (it always runs top-down).
287
- assert (!IsHazardRecognizerMode &&
288
- " Bottom-up scheduling shouldn't run in hazard recognizer mode" );
289
-
290
- // Step through each instruction in the bundle in bottom-up order.
291
- MachineBasicBlock::instr_iterator MI =
292
- std::next (CurrCycleInstr->getIterator ());
293
- MachineBasicBlock::instr_iterator E =
294
- CurrCycleInstr->getParent ()->instr_end ();
295
-
296
- // Evict stale entries to maintain a fixed lookahead window.
297
- // TODO: Hazard detection is not yet implemented. This scheduling
298
- // is intended for GFX11 and newer.
299
- for (; MI != E && MI->isInsideBundle (); ++MI) {
300
- CurrCycleInstr = &*MI;
301
-
302
- // Remove up to (MaxLookAhead - 1) oldest entries.
303
- for (unsigned I = 0 , E = MaxLookAhead - 1 ; I < E && !EmittedInstrs.empty ();
304
- ++I)
305
- EmittedInstrs.pop_back ();
306
-
307
- EmittedInstrs.push_back (CurrCycleInstr);
308
-
309
- // Keep only the most recent MaxLookAhead entries
310
- EmittedInstrs.resize (MaxLookAhead);
311
- }
312
-
313
- CurrCycleInstr = nullptr ;
314
- }
315
-
316
283
void GCNHazardRecognizer::runOnInstruction (MachineInstr *MI) {
317
284
assert (IsHazardRecognizerMode);
318
285
@@ -450,41 +417,9 @@ void GCNHazardRecognizer::AdvanceCycle() {
450
417
}
451
418
452
419
void GCNHazardRecognizer::RecedeCycle () {
453
- // If no instruction was issued this cycle, pop the oldest placeholder.
454
- if (!CurrCycleInstr) {
455
- if (!EmittedInstrs.empty ())
456
- EmittedInstrs.pop_back ();
457
- return ;
458
- }
459
-
460
- // If this is a bundle header, handle the entire bundle here.
461
- if (CurrCycleInstr->isBundle ()) {
462
- processBundleBottomUp ();
463
- return ;
464
- }
465
-
466
- unsigned NumWaitStates = TII.getNumWaitStates (*CurrCycleInstr);
467
- if (!NumWaitStates) {
468
- CurrCycleInstr = nullptr ;
469
- return ;
470
- }
471
-
472
- // Add current instruction to the emitted list.
473
- EmittedInstrs.push_back (CurrCycleInstr);
474
-
475
- // Model remaining wait states by removing older placeholders.
476
- for (unsigned I = 1 , E = std::min (NumWaitStates, getMaxLookAhead ()); I < E;
477
- ++I) {
478
- if (!EmittedInstrs.empty ())
479
- EmittedInstrs.pop_back ();
480
- }
481
-
482
- // getMaxLookahead() is the largest number of wait states we will ever need
483
- // to insert, so there is no point in keeping track of more than that many
484
- // wait states.
485
- EmittedInstrs.resize (getMaxLookAhead ());
486
-
487
- CurrCycleInstr = nullptr ;
420
+ if (IsHazardRecognizerMode || ST.getGeneration () < AMDGPUSubtarget::GFX11)
421
+ llvm_unreachable (
422
+ " hazard recognizer does not support bottom-up scheduling." );
488
423
}
489
424
490
425
// ===----------------------------------------------------------------------===//
0 commit comments