crash: Assertion failed: (MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"), function restoreCalleeSavedRegisters, file RISCVFrameLowering.cpp

Run:explore-db12fc36f6-20261127-115111
Kind:crash
Category:Assertion failed: (MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"), function restoreCalleeSavedRegisters, file RISCVFrameLowering.cpp M
Occurrences:3 in 3 configs, 1 test files, 91 more counted only
Snippet from:qci-interrupt-zilsd.762dd9ca6a.ll (mutant of qci-interrupt-zilsd.ll) @test_nonest_empty via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3
Local check:reproduces at db12fc36f6
Compiler Explorer:https://godbolt.org/z/ba54PG5K5 (llc-assertions-trunk, checked 2026-11-27 15:30 UTC): G reproduces

Snippet:

@G = external global i32

define void @test_nonest_empty() #0 {
  %B = sub i32 42, 1
  store i32 %B, ptr @G, align 4
  ret void
}

attributes #0 = { "interrupt"="qci-nonest" }

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340llc: /root/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:2753: virtual bool llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(llvm::MachineBasicBlock&, llvm::MachineBasicBlock::iterator, llvm::MutableArrayRef<llvm::CalleeSavedInfo>, const llvm::TargetRegisterInfo*) const: Assertion `MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
SelectionDAG (control)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3 -global-isel=0021-

Reproduce:

llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3 -global-isel=0 snippet.ll -o -

Local llc output:

llc: /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:2929: virtual bool llvm::RISCVFrameLowering::restoreCalleeSavedRegisters(MachineBasicBlock &, MachineBasicBlock::iterator, MutableArrayRef<CalleeSavedInfo>, const TargetRegisterInfo *) const: Assertion `MI->getOpcode() == RISCV::QC_C_MILEAVERET && "Unexpected QCI Interrupt Return Instruction"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0.	Program arguments: /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/build/bin/llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* -o -
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@test_nonest_empty'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  llc       0x000055c5dc360c1b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x000055c5dc35dbf1 llvm::sys::RunSignalHandlers() + 369
2  llc       0x000055c5dc36169b
3  libc.so.6 0x00007f315b445330
4  libc.so.6 0x00007f315b49ebec pthread_kill + 284
5  libc.so.6 0x00007f315b44527e gsignal + 30
6  libc.so.6 0x00007f315b4288ff abort + 223
7  libc.so.6 0x00007f315b42881b
8  libc.so.6 0x00007f315b43b517
9  llc       0x000055c5da83d8ed
10 llc       0x000055c5db1d2764
11 llc       0x000055c5db1d7647
12 llc       0x000055c5dafd9761 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
13 llc       0x000055c5db575a77 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
14 llc       0x000055c5db57df92 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
15 llc       0x000055c5db576820 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
16 llc       0x000055c5da7d0689
17 llc       0x000055c5da7cd813 main + 1747
18 libc.so.6 0x00007f315b42a1ca
19 libc.so.6 0x00007f315b42a28b __libc_start_main + 139
20 llc       0x000055c5da7cc925 _start + 37

Occurrences (3):

InputFunctionConfig
qci-interrupt-zilsd.762dd9ca6a.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zbkb -O3
qci-interrupt-zilsd.c2d62f6280.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd -O2
qci-interrupt-zilsd.c3e7219d65.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+c -O2 -code-model=small

Generated 2026-11-29 14:49 UTC.