Skip to content

Commit 0c84158

Browse files
committed
address comments
1 parent 115327a commit 0c84158

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/MachineScheduler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3512,7 +3512,7 @@ void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
35123512
RegionPolicy.OnlyTopDown = false;
35133513
}
35143514

3515-
this->BotIdx = NumRegionInstrs - 1;
3515+
BotIdx = NumRegionInstrs - 1;
35163516
this->NumRegionInstrs = NumRegionInstrs;
35173517
}
35183518

@@ -3995,6 +3995,7 @@ SUnit *GenericScheduler::pickNode(bool &IsTopNode) {
39953995
if (SU->NodeNum == TopIdx++)
39963996
++NumInstrsInSourceOrderPreRA;
39973997
} else {
3998+
assert(BotIdx < NumRegionInstrs && "out of bounds");
39983999
if (SU->NodeNum == BotIdx--)
39994000
++NumInstrsInSourceOrderPreRA;
40004001
}
@@ -4348,6 +4349,7 @@ SUnit *PostGenericScheduler::pickNode(bool &IsTopNode) {
43484349
if (SU->NodeNum == TopIdx++)
43494350
++NumInstrsInSourceOrderPostRA;
43504351
} else {
4352+
assert(BotIdx < NumRegionInstrs && "out of bounds");
43514353
if (SU->NodeNum == BotIdx--)
43524354
++NumInstrsInSourceOrderPostRA;
43534355
}

0 commit comments

Comments
 (0)