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

Run:explore-d9924131a4-20261128-105811
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, 93 more counted only
Snippet from:qci-interrupt-zilsd.58dfcb9ac0.ll (mutant of qci-interrupt-zilsd.ll) @test_nest_empty via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c -O2
Local check:reproduces at d9924131a4
Compiler Explorer:https://godbolt.org/z/jfPPEjf6W (llc-assertions-trunk, checked 2026-11-28 14:45 UTC): G reproduces

Snippet:

@G.3 = external global i1

define void @test_nest_empty() #0 {
  %LGV = load i1, ptr @G.3, align 1
  %B = sdiv i1 %LGV, true
  store i1 %B, ptr @G.3, align 1
  ret void
}

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

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c -O2 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340llc: /root/llvm-project/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp:2928: 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,+zclsd,+c -O2 -global-isel=002-

Reproduce:

llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c -O2 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c -O2 -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,+zclsd,+c -O2 -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_nest_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       0x0000555861fd8b5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x0000555861fd5b31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x0000555861fd95db
3  libc.so.6 0x00007f3440645330
4  libc.so.6 0x00007f344069ebec pthread_kill + 284
5  libc.so.6 0x00007f344064527e gsignal + 30
6  libc.so.6 0x00007f34406288ff abort + 223
7  libc.so.6 0x00007f344062881b
8  libc.so.6 0x00007f344063b517
9  llc       0x00005558604b5b2d
10 llc       0x0000555860e4a894
11 llc       0x0000555860e4f777
12 llc       0x0000555860c51891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
13 llc       0x00005558611ed7f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
14 llc       0x00005558611f5d12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
15 llc       0x00005558611ee5a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
16 llc       0x00005558604488c9
17 llc       0x0000555860445a53 main + 1747
18 libc.so.6 0x00007f344062a1ca
19 libc.so.6 0x00007f344062a28b __libc_start_main + 139
20 llc       0x0000555860444b65 _start + 37

Occurrences (3):

InputFunctionConfig
qci-interrupt-zilsd.539130c9b8.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zba -O3
qci-interrupt-zilsd.58dfcb9ac0.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd,+zclsd,+c -O2
qci-interrupt-zilsd.e838ceb54a.ll (mutant of qci-interrupt-zilsd.ll)-mtriple=riscv32 -verify-machineinstrs -mattr=+xqciint,+zilsd -O3

Generated 2026-11-29 14:49 UTC.