diff options
author | Clement Courbet <courbet@google.com> | 2023-03-02 13:34:43 +0100 |
---|---|---|
committer | Clement Courbet <courbet@google.com> | 2023-03-02 13:43:26 +0100 |
commit | 28eef3bd5bc7cf2544df6fd8ab83c67e500b126c (patch) | |
tree | a5b55841e196b10fde05b25a3193ae7a15d8a224 /llvm/lib/MCA | |
parent | 948ed21f1251f2ca1456057d5289b4c29c8d7aad (diff) | |
download | llvm-28eef3bd5bc7cf2544df6fd8ab83c67e500b126c.zip llvm-28eef3bd5bc7cf2544df6fd8ab83c67e500b126c.tar.gz llvm-28eef3bd5bc7cf2544df6fd8ab83c67e500b126c.tar.bz2 |
[MCA] Fix crash in `EntryStage::cycleEnd` when there are no instructions.
Diffstat (limited to 'llvm/lib/MCA')
-rw-r--r-- | llvm/lib/MCA/Stages/EntryStage.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/MCA/Stages/EntryStage.cpp b/llvm/lib/MCA/Stages/EntryStage.cpp index 6b3fbb8..5c82ce7 100644 --- a/llvm/lib/MCA/Stages/EntryStage.cpp +++ b/llvm/lib/MCA/Stages/EntryStage.cpp @@ -67,7 +67,8 @@ llvm::Error EntryStage::cycleResume() { llvm::Error EntryStage::cycleEnd() { // Find the first instruction which hasn't been retired. - auto Range = make_range(&Instructions[NumRetired], Instructions.end()); + auto Range = + make_range(Instructions.begin() + NumRetired, Instructions.end()); auto It = find_if(Range, [](const std::unique_ptr<Instruction> &I) { return !I->isRetired(); }); |