Skip to content

Commit efd40ca

Browse files
committed
address comments
1 parent bd71a9d commit efd40ca

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
@@ -3514,7 +3514,7 @@ void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
35143514
RegionPolicy.OnlyTopDown = false;
35153515
}
35163516

3517-
this->BotIdx = NumRegionInstrs - 1;
3517+
BotIdx = NumRegionInstrs - 1;
35183518
this->NumRegionInstrs = NumRegionInstrs;
35193519
}
35203520

@@ -3997,6 +3997,7 @@ SUnit *GenericScheduler::pickNode(bool &IsTopNode) {
39973997
if (SU->NodeNum == TopIdx++)
39983998
++NumInstrsInSourceOrderPreRA;
39993999
} else {
4000+
assert(BotIdx < NumRegionInstrs && "out of bounds");
40004001
if (SU->NodeNum == BotIdx--)
40014002
++NumInstrsInSourceOrderPreRA;
40024003
}
@@ -4350,6 +4351,7 @@ SUnit *PostGenericScheduler::pickNode(bool &IsTopNode) {
43504351
if (SU->NodeNum == TopIdx++)
43514352
++NumInstrsInSourceOrderPostRA;
43524353
} else {
4354+
assert(BotIdx < NumRegionInstrs && "out of bounds");
43534355
if (SU->NodeNum == BotIdx--)
43544356
++NumInstrsInSourceOrderPostRA;
43554357
}

0 commit comments

Comments
 (0)