crash: remark: <unknown>:0:0: unable to legalize instruction: G_STORE N:_(<4 x i1>), N:_(p0) :: (store (<4 x i1>) into %ir.A11)

Run:explore-d9924131a4-20261128-105811
Kind:crash
Category:remark: <unknown>:0:0: unable to legalize instruction: G_STORE N:_(<4 x i1>), N:_(p0) :: (store (<4 x i1>) into %ir.A11)
Occurrences:3 in 3 configs, 1 test files, 10 more counted only
Snippet from:double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.a8c6700694.ll (mutant of double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.ll) via full input
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small
Local check:reproduces at d9924131a4
Compiler Explorer:https://godbolt.org/z/McM19W3xb (llc-assertions-trunk, checked 2026-11-28 14:45 UTC): G crashes differently

Snippet:

; ModuleID = '<stdin>'
source_filename = "<stdin>"

@G = global i1 false
@G.1 = global <4 x i1> splat (i1 true)
@G.2 = global <4 x i32> splat (i32 -1)
@G.3 = global i32 42
@G.4 = global double 0.000000e+00
@G.5 = global i1 false
@G.6 = global i1 false
@G.7 = global i32 -2147483648
@G.8 = global double +inf
@G.9 = global <8 x i8> splat (i8 -128)
@G.10 = global i64 1
@G.11 = global i16 1
@G.12 = global i1 false
@G.13 = global i128 -170141183460469231731687303715884105728
@G.14 = global <4 x i32> splat (i32 65536)
@G.15 = global i8 42
@G.16 = global <4 x i32> splat (i32 1)
@G.17 = global i8 127
@G.18 = global i64 0

; Function Attrs: nounwind
declare float @fcvt_s_d(double) #0

; Function Attrs: nounwind
declare double @fcvt_d_s(float) #0

; Function Attrs: nounwind
declare i32 @fcvt_w_d(double) #0

; Function Attrs: nounwind
declare i32 @fcvt_w_d_sat(double) #0

; Function Attrs: nounwind
declare i32 @fcvt_wu_d(double) #0

; Function Attrs: nounwind
declare i32 @fcvt_wu_d_multiple_use(double, ptr) #0

; Function Attrs: nounwind
define i32 @fcvt_wu_d_sat(double %a) #0 {
start:
  %A11 = alloca <4 x i1>, align 1
  store <4 x i1> poison, ptr %A11, align 1
  %A17 = alloca i64, align 8
  store i64 0, ptr %A17, align 4
  %A15 = alloca <4 x i32>, align 16
  store <4 x i32> poison, ptr %A15, align 16
  %A6 = alloca i16, align 2
  store i16 256, ptr %A6, align 2
  %A1 = alloca i32, align 4
  store i32 poison, ptr %A1, align 4
  %LGV2 = load double, ptr @G.4, align 8
  %A = alloca <4 x i32>, align 16
  %L = load i8, ptr %A, align 1
  %C = fcmp une double %a, %LGV2
  store <4 x i32> poison, ptr %A, align 16
  %LGV1 = load i32, ptr @G.3, align 4
  %LGV = load <4 x i32>, ptr @G.2, align 16
  %0 = tail call i32 @llvm.fptoui.sat.i32.f64(double %a)
  %I = insertelement <4 x i32> %LGV, i32 %LGV1, i1 false
  store <4 x i32> %I, ptr %A, align 16
  store i1 %C, ptr @G.5, align 1
  switch i8 %L, label %SW_D [
    i8 -73, label %SW_C
    i8 50, label %SW_C3
    i8 71, label %SW_C4
    i8 118, label %SW_C5
    i8 -69, label %SW_C6
    i8 29, label %SW_C7
    i8 55, label %SW_C8
    i8 30, label %SW_C9
  ]

BB:                                               ; preds = %SW_C6, %BB9, %SW_C4, %SW_C3, %BB16, %SW_D
  ret i32 %0

SW_D:                                             ; preds = %start
  br label %BB

SW_C:                                             ; preds = %start
  %L7 = load i16, ptr %A6, align 2
  switch i16 %L7, label %SW_D8 [
    i16 10452, label %SW_C10
  ]

BB5:                                              ; preds = %BB1
  %L18 = load i64, ptr %A17, align 4
  switch i64 %L18, label %SW_D19 [
    i64 2452265915540248962, label %SW_C20
    i64 3533949806990849907, label %SW_C21
    i64 9129827870310699017, label %SW_C22
  ]

BB16:                                             ; preds = %SW_C22, %SW_C20, %SW_D19
  br label %BB

SW_C3:                                            ; preds = %SW_C3, %start
  %LGV10 = load i1, ptr @G.6, align 1
  %B = shl i32 %LGV1, 42
  store i32 %B, ptr %A1, align 4
  br i1 %LGV10, label %SW_C3, label %BB

SW_C4:                                            ; preds = %start
  br label %BB

SW_C5:                                            ; preds = %start
  br i1 %C, label %T10, label %F11

BB9:                                              ; preds = %F11
  br label %BB

SW_C6:                                            ; preds = %SW_C6, %start
  br i1 %C, label %BB, label %SW_C6

SW_C7:                                            ; preds = %start
  %LGV3 = load i16, ptr @G.11, align 2
  %C4 = icmp slt i16 1, %LGV3
  store i1 %C4, ptr %A1, align 1
  ret i32 %0

SW_C8:                                            ; preds = %start
  %LGV12 = load i32, ptr @G.7, align 4
  %C11 = icmp ult i32 %LGV12, %0
  store i1 %C11, ptr %A6, align 1
  ret i32 %LGV12

SW_C9:                                            ; preds = %start
  ret i32 %0

SW_D8:                                            ; preds = %SW_C
  %LGV22 = load <4 x i32>, ptr @G.14, align 16
  %B23 = mul <4 x i32> %LGV22, %LGV
  store <4 x i32> %B23, ptr @G.14, align 16
  switch i32 %LGV1, label %SW_D2 [
    i32 -1511306095, label %SW_C11
    i32 1535392864, label %SW_C12
    i32 -808852141, label %SW_C13
    i32 430897025, label %SW_C14
    i32 1292181252, label %SW_C15
    i32 1602174823, label %SW_C16
    i32 -1816059589, label %SW_C17
  ]

BB1:                                              ; preds = %SW_C17, %SW_C16, %SW_C14, %BB2, %SW_C12, %BB18
  br label %BB5

SW_C10:                                           ; preds = %SW_C
  %C19 = fcmp olt double %a, %a
  store i1 %C19, ptr @G.12, align 1
  ret i32 %LGV1

SW_D2:                                            ; preds = %BB18, %SW_D8
  br i1 %C, label %T, label %F

BB18:                                             ; preds = %T
  %B14 = and <4 x i32> %LGV22, splat (i32 65536)
  %C10 = icmp eq <4 x i32> splat (i32 42), %B14
  %LGV20 = load i128, ptr @G.13, align 4
  %C21 = icmp sge i128 42, %LGV20
  store i1 %C21, ptr %A6, align 1
  store <4 x i32> %B14, ptr %A15, align 16
  store <4 x i1> %C10, ptr %A11, align 1
  br i1 %C, label %SW_D2, label %BB1

SW_C11:                                           ; preds = %SW_D8
  %1 = phi double [ %LGV2, %SW_D8 ]
  %B5 = fdiv double %a, %LGV2
  store double %B5, ptr %A6, align 8
  store double %1, ptr @G.8, align 8
  ret i32 42

SW_C12:                                           ; preds = %SW_D8
  br label %BB1

SW_C13:                                           ; preds = %SW_D8
  br i1 %C, label %T3, label %F4

BB2:                                              ; preds = %T3
  br label %BB1

SW_C14:                                           ; preds = %SW_D8
  br label %BB1

SW_C15:                                           ; preds = %SW_D8
  %C1 = icmp uge <4 x i32> %B23, %B23
  store <4 x i1> %C1, ptr poison, align 1
  ret i32 42

SW_C16:                                           ; preds = %SW_D8
  %B8 = and i64 -9223372036854775808, 42
  store i64 %B8, ptr %A6, align 4
  br label %BB1

SW_C17:                                           ; preds = %SW_D8
  %B1 = add i16 %L7, %L7
  store i16 %B1, ptr poison, align 2
  br label %BB1

T:                                                ; preds = %SW_D2
  br label %BB18

F:                                                ; preds = %SW_D2
  %E = extractelement <2 x i64> splat (i64 4294967296), i64 42
  store i64 %E, ptr @G.18, align 4
  ret i32 42

T10:                                              ; preds = %SW_C5
  ret i32 %0

F11:                                              ; preds = %SW_C5
  br label %BB9

SW_D19:                                           ; preds = %BB5
  br label %BB16

SW_C20:                                           ; preds = %SW_C20, %BB5
  br i1 %C, label %BB16, label %SW_C20

SW_C21:                                           ; preds = %BB5
  ret i32 -1

SW_C22:                                           ; preds = %BB5
  %B9 = sdiv i1 false, false
  store i1 %B9, ptr poison, align 1
  br label %BB16

T3:                                               ; preds = %SW_C13
  br label %BB2

F4:                                               ; preds = %SW_C13
  ret i32 %0
}

; Function Attrs: nounwind
declare double @fcvt_d_w(i32) #0

; Function Attrs: nounwind
declare double @fcvt_d_w_load(ptr) #0

; Function Attrs: nounwind
declare double @fcvt_d_wu(i32) #0

; Function Attrs: nounwind
declare double @fcvt_d_wu_load(ptr) #0

; Function Attrs: nounwind
declare i64 @fcvt_l_d(double) #0

; Function Attrs: nounwind
declare i64 @fcvt_l_d_sat(double) #0

; Function Attrs: nounwind
declare i64 @fcvt_lu_d(double) #0

; Function Attrs: nounwind
declare i64 @fcvt_lu_d_sat(double) #0

; Function Attrs: nounwind
declare i64 @fmv_x_d(double, double) #0

; Function Attrs: nounwind
declare double @fcvt_d_l(i64) #0

; Function Attrs: nounwind
declare double @fcvt_d_lu(i64) #0

; Function Attrs: nounwind
declare double @fmv_d_x(i64, i64) #0

; Function Attrs: nounwind
declare double @fcvt_d_w_i8(i8 signext) #0

; Function Attrs: nounwind
declare double @fcvt_d_wu_i8(i8 zeroext) #0

; Function Attrs: nounwind
declare double @fcvt_d_w_i16(i16 signext) #0

; Function Attrs: nounwind
declare double @fcvt_d_wu_i16(i16 zeroext) #0

; Function Attrs: nounwind
declare signext i32 @fcvt_d_w_demanded_bits(i32 signext, ptr) #0

; Function Attrs: nounwind
declare signext i32 @fcvt_d_wu_demanded_bits(i32 signext, ptr) #0

; Function Attrs: nounwind
declare signext i16 @fcvt_w_s_i16(double) #0

; Function Attrs: nounwind
declare signext i16 @fcvt_w_s_sat_i16(double) #0

; Function Attrs: nounwind
declare zeroext i16 @fcvt_wu_s_i16(double) #0

; Function Attrs: nounwind
declare zeroext i16 @fcvt_wu_s_sat_i16(double) #0

; Function Attrs: nounwind
declare signext i8 @fcvt_w_s_i8(double) #0

; Function Attrs: nounwind
declare signext i8 @fcvt_w_s_sat_i8(double) #0

; Function Attrs: nounwind
define zeroext i8 @fcvt_wu_s_i8(double %a) #0 {
  %A4 = alloca i16, align 2
  store i16 -32768, ptr %A4, align 2
  %A7 = alloca i1, align 1
  store i1 true, ptr %A7, align 1
  %A3 = alloca i1, align 1
  %L2 = load i32, ptr %A3, align 4
  store i1 poison, ptr %A3, align 1
  %A = alloca i1, align 1
  switch i32 %L2, label %SW_D [
    i32 1233189670, label %SW_C
    i32 2094690348, label %SW_C3
    i32 -1935030654, label %SW_C4
    i32 -987585556, label %SW_C5
    i32 1113009757, label %SW_C6
  ]

BB1:                                              ; preds = %SW_C6, %SW_C4, %SW_C3, %SW_C
  %B4 = fdiv double %a, %a
  store i1 false, ptr %A, align 1
  %C = fcmp true double %a, 4.940660e-324
  store double %B4, ptr poison, align 8
  br i1 %C, label %T, label %F

BB:                                               ; preds = %F, %T
  %C2 = fcmp oeq float f0x7F7FFFFF, 4.200000e+01
  %1 = fptoui double %a to i8
  %B = fdiv double %a, %a
  store i1 %C, ptr @G, align 1
  store double %B, ptr @G.8, align 8
  store i1 %C2, ptr %A3, align 1
  %L5 = load i16, ptr %A4, align 2
  switch i16 %L5, label %SW_D6 [
    i16 27747, label %SW_C7
    i16 -23092, label %SW_C8
    i16 -15956, label %SW_C9
    i16 -26630, label %SW_C10
    i16 -11991, label %SW_C11
    i16 -10931, label %SW_C12
    i16 20281, label %SW_C13
    i16 25493, label %SW_C14
  ]

BB2:                                              ; preds = %SW_C14, %SW_C13, %SW_C12, %SW_C11, %SW_C10, %SW_C9, %SW_C8, %SW_C7
  ret i8 %1

T:                                                ; preds = %T, %BB1
  %L = load i1, ptr %A, align 1
  %B3 = add i1 %C, %C
  %B1 = or i1 %L, %C
  store i1 %B3, ptr %A7, align 1
  br i1 %B1, label %T, label %BB

F:                                                ; preds = %BB1
  %B2 = srem <4 x i32> zeroinitializer, splat (i32 42)
  store <4 x i32> %B2, ptr poison, align 16
  br label %BB

SW_D:                                             ; preds = %0
  ret i8 -1

SW_C:                                             ; preds = %0
  br label %BB1

SW_C3:                                            ; preds = %SW_C3, %0
  %L8 = load i1, ptr %A7, align 1
  br i1 %L8, label %SW_C3, label %BB1

SW_C4:                                            ; preds = %0
  br label %BB1

SW_C5:                                            ; preds = %0
  %LGV9 = load i8, ptr @G.15, align 1
  ret i8 %LGV9

SW_C6:                                            ; preds = %0
  br label %BB1

SW_D6:                                            ; preds = %BB
  %LGV = load i8, ptr @G.17, align 1
  ret i8 %LGV

SW_C7:                                            ; preds = %BB
  br label %BB2

SW_C8:                                            ; preds = %BB
  br label %BB2

SW_C9:                                            ; preds = %SW_C9, %BB
  br i1 %C, label %SW_C9, label %BB2

SW_C10:                                           ; preds = %BB
  br label %BB2

SW_C11:                                           ; preds = %SW_C11, %BB
  br i1 %C2, label %SW_C11, label %BB2

SW_C12:                                           ; preds = %BB
  br label %BB2

SW_C13:                                           ; preds = %BB
  br label %BB2

SW_C14:                                           ; preds = %BB
  br label %BB2
}

; Function Attrs: nounwind
declare zeroext i8 @fcvt_wu_s_sat_i8(double) #0

; Function Attrs: nounwind
declare zeroext i32 @fcvt_wu_d_sat_zext(double) #0

; Function Attrs: nounwind
declare signext i32 @fcvt_w_d_sat_sext(double) #0

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.fptosi.sat.i16.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.fptosi.sat.i32.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.fptosi.sat.i64.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.fptosi.sat.i8.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.fptoui.sat.i16.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.fptoui.sat.i32.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.fptoui.sat.i64.f64(double) #1

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.fptoui.sat.i8.f64(double) #1

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

Compiler Explorer panes:

PaneOptionsExitInstsstderr
GlobalISel-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.*1340remark: <unknown>:0:0: unable to legalize instruction: G_STORE %104:_(<4 x i1>), %1:_(p0) :: (store (<4 x i1>) into %ir.A11) (in function: fcvt_wu_d_sat)
warning: Instruction selection used fallback path for fcvt_wu_d_sat
Unhandled predicate
SelectionDAG (control)-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small -global-isel=00313-

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: G_STORE %104:_(<4 x i1>), %1:_(p0) :: (store (<4 x i1>) into %ir.A11) (in function: fcvt_wu_d_sat)
warning: Instruction selection used fallback path for fcvt_wu_d_sat
Unhandled predicate
UNREACHABLE executed at /home/runner/work/llvm-fuzz/llvm-fuzz/llvm-project/llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp:2295!
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 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* -o -
1.	Running pass 'Function Pass Manager' on module '<stdin>'.
2.	Running pass 'InstructionSelect' on function '@fcvt_wu_s_i8'
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       0x000055840af24b5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x000055840af21b31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x000055840af255db
3  libc.so.6 0x00007f63bcc45330
4  libc.so.6 0x00007f63bcc9ebec pthread_kill + 284
5  libc.so.6 0x00007f63bcc4527e gsignal + 30
6  libc.so.6 0x00007f63bcc288ff abort + 223
7  llc       0x000055840ae7d3cf
8  llc       0x000055840959de0e
9  llc       0x0000558409592213
10 llc       0x000055840b81d527 llvm::InstructionSelectImpl::selectMachineFunction(llvm::MachineFunction&) + 1255
11 llc       0x000055840b81ecc1 llvm::InstructionSelectLegacy::runOnMachineFunction(llvm::MachineFunction&) + 417
12 llc       0x0000558409b9d891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
13 llc       0x000055840a1397f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
14 llc       0x000055840a141d12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
15 llc       0x000055840a13a5a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
16 llc       0x00005584093948c9
17 llc       0x0000558409391a53 main + 1747
18 libc.so.6 0x00007f63bcc2a1ca
19 libc.so.6 0x00007f63bcc2a28b __libc_start_main + 139
20 llc       0x0000558409390b65 _start + 37

Occurrences (3):

InputFunctionConfig
double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.a8c6700694.ll (mutant of double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.ll)-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3 -code-model=small
double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.fc4dfa988d.ll (mutant of double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.ll)-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa,+m -O1
double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.ba0bec97.ll-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa -O3

Generated 2026-11-29 14:49 UTC.