[llvm] Fix assert in SlotIndexes::getInstructionIndex in debug builds (PR #189370)
Daniil Fukalov via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 07:27:00 PDT 2026
================
@@ -1174,12 +1174,15 @@ void SIWholeQuadMode::toExact(MachineBasicBlock &MBB,
Register SaveWQM) {
assert(LiveMaskReg.isVirtual());
- bool IsTerminator = Before == MBB.end();
+ auto MBBE = MBB.end();
+ bool IsTerminator = Before == MBBE;
if (!IsTerminator) {
auto FirstTerm = MBB.getFirstTerminator();
- if (FirstTerm != MBB.end()) {
- SlotIndex FirstTermIdx = LIS->getInstructionIndex(*FirstTerm);
- SlotIndex BeforeIdx = LIS->getInstructionIndex(*Before);
+ auto FirstNonDbg = skipDebugInstructionsForward(FirstTerm, MBBE);
+ if (FirstNonDbg != MBBE) {
+ auto BeforeNonDbg = skipDebugInstructionsForward(Before, MBBE);
----------------
dfukalov wrote:
It seems the link is to this change. Although I would say in most places `skipDebugInstructionsForward()` doesn't use `auto`.
https://github.com/llvm/llvm-project/pull/189370
More information about the llvm-commits
mailing list