[SLP] Add assert that entities are scheduled as expected

Requested in D118538
This commit is contained in:
Philip Reames 2022-02-15 12:20:33 -08:00
parent b077ee9240
commit 2e50760775
1 changed files with 11 additions and 0 deletions

View File

@ -7952,6 +7952,17 @@ void BoUpSLP::scheduleBlock(BlockScheduling *BS) {
BS->verify();
#endif
#ifndef NDEBUG
// Check that all schedulable entities got scheduled
for (auto *I = BS->ScheduleStart; I != BS->ScheduleEnd; I = I->getNextNode()) {
BS->doForAllOpcodes(I, [&](ScheduleData *SD) {
if (SD->isSchedulingEntity() && SD->hasValidDependencies()) {
assert(SD->IsScheduled && "must be scheduled at this point");
}
});
}
#endif
// Avoid duplicate scheduling of the block.
BS->ScheduleStart = nullptr;
}