Skip to content

Commit 28eef3b

Browse files
committed
[MCA] Fix crash in EntryStage::cycleEnd when there are no instructions.
1 parent 948ed21 commit 28eef3b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/MCA/Stages/EntryStage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ llvm::Error EntryStage::cycleResume() {
6767

6868
llvm::Error EntryStage::cycleEnd() {
6969
// Find the first instruction which hasn't been retired.
70-
auto Range = make_range(&Instructions[NumRetired], Instructions.end());
70+
auto Range =
71+
make_range(Instructions.begin() + NumRetired, Instructions.end());
7172
auto It = find_if(Range, [](const std::unique_ptr<Instruction> &I) {
7273
return !I->isRetired();
7374
});

0 commit comments

Comments
 (0)