crash: LLVM ERROR: Found 2 machine code errors.

Run:explore-b577f07195-20261129-105236
Kind:crash
Category:LLVM ERROR: Found 2 machine code errors.
Occurrences:3 in 3 configs, 3 test files, 220 more counted only
Snippet from:vsetvli-insert-O0.ll @intrinsic_same_vlmax via llvm-extract
Config:-mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0
Local check:reproduces at b577f07195
Compiler Explorer:https://godbolt.org/z/5heqPxzYK (llc-assertions-trunk, checked 2026-10-26 12:20 UTC): G reproduces

Snippet:

; Function Attrs: nounwind
define <vscale x 1 x double> @intrinsic_same_vlmax(<vscale x 1 x double> %a, <vscale x 1 x double> %b) #0 {
entry:
  %0 = tail call i64 @llvm.riscv.vsetvlimax.i64(i64 2, i64 7)
  %1 = tail call <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64.i64(<vscale x 1 x double> poison, <vscale x 1 x double> %a, <vscale x 1 x double> %b, i64 7, i64 %0)
  %2 = tail call <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64.i64(<vscale x 1 x double> poison, <vscale x 1 x double> %1, <vscale x 1 x double> %b, i64 7, i64 %0)
  ret <vscale x 1 x double> %2
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare <vscale x 1 x double> @llvm.riscv.vfadd.nxv1f64.nxv1f64.i64(<vscale x 1 x double>, <vscale x 1 x double>, <vscale x 1 x double>, i64 immarg, i64) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.riscv.vsetvlimax.i64(i64 immarg, i64 immarg) #1

attributes #0 = { nounwind }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340
# After InstructionSelect
# Machine code for function intrinsic_same_vlmax: IsSSA, TracksLiveness, Legalized, RegBankSelected, Selected
SelectionDAG (control)-mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0 -global-isel=007-

Reproduce:

llc -mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0 -global-isel=0 snippet.ll -o -

Local llc output:

# After InstructionSelect
# Machine code for function intrinsic_same_vlmax: IsSSA, TracksLiveness, Legalized, RegBankSelected, Selected
Function Live Ins: $v8, $v9
bb.1.entry:
  liveins: $v8, $v9
  %0:vr = COPY $v8
  %1:vr = COPY $v9
  %4:vr = IMPLICIT_DEF
  %2:gprnox0 = PseudoVSETVLIX0 $x0, 215, implicit-def $vl, implicit-def $vtype
  %3:vr = nofpexcept PseudoVFADD_VV_M1_E64 %4:vr(tied-def 0), %0:vr, %1:vr, 7, %2:gprnox0, 6, 0
  %5:vr = nofpexcept PseudoVFADD_VV_M1_E64 %4:vr(tied-def 0), %3:vr, %1:vr, 7, %2:gprnox0, 6, 0
  $v8 = COPY %5:vr
  PseudoRET implicit $v8
# End machine code for function intrinsic_same_vlmax.
*** Bad machine code: dynamic rounding mode should read FRM ***
- function:    intrinsic_same_vlmax
- basic block: %bb.1 entry (0x55b2141c00c0)
- instruction: %3:vr = nofpexcept PseudoVFADD_VV_M1_E64 %4:vr(tied-def 0), %0:vr, %1:vr, 7, %2:gprnox0, 6, 0
*** Bad machine code: dynamic rounding mode should read FRM ***
- function:    intrinsic_same_vlmax
- basic block: %bb.1 entry (0x55b2141c00c0)
- instruction: %5:vr = nofpexcept PseudoVFADD_VV_M1_E64 %4:vr(tied-def 0), %3:vr, %1:vr, 7, %2:gprnox0, 6, 0
LLVM ERROR: Found 2 machine code errors.
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=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* -o -
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'Verify generated machine code' on function '@intrinsic_same_vlmax'
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       0x000055b1fd4c49eb llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x000055b1fd4c19c1 llvm::sys::RunSignalHandlers() + 369
2  llc       0x000055b1fd4c546b
3  libc.so.6 0x00007fc175245330
4  libc.so.6 0x00007fc17529ebec pthread_kill + 284
5  libc.so.6 0x00007fc17524527e gsignal + 30
6  libc.so.6 0x00007fc1752288ff abort + 223
7  llc       0x000055b1fd41cdfd llvm::report_fatal_error(llvm::Twine const&, bool) + 429
8  llc       0x000055b1fc280533
9  llc       0x000055b1fc281693
10 llc       0x000055b1fc13e6b1 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
11 llc       0x000055b1fc6d9b37 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
12 llc       0x000055b1fc6e2052 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
13 llc       0x000055b1fc6da8e0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
14 llc       0x000055b1fb935149
15 llc       0x000055b1fb9322d3 main + 1747
16 libc.so.6 0x00007fc17522a1ca
17 libc.so.6 0x00007fc17522a28b __libc_start_main + 139
18 llc       0x000055b1fb9313e5 _start + 37

Occurrences (3):

InputFunctionConfig
vsetvli-insert-O0.ll-mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O0
vsetvli-insert-crossbb.ll-mtriple=riscv64 -mattr=+m,+f,+d,+a,+c,+v -target-abi=lp64d -verify-machineinstrs -O2
zvfofp8min-alt-interlave.9502fd4234.ll (mutant of zvfofp8min-alt-interlave.ll)-mtriple=riscv32 -verify-machineinstrs -target-abi=ilp32d -mattr=+v,+zvfbfmin,+experimental-zvfofp8min -O2

Generated 2026-11-29 14:49 UTC.