crash: remark: <unknown>:0:0: unable to legalize instruction: G_STORE N:_(<8 x i1>), N:_(p0) :: (store (<8 x i1>) into @G.19)

Run:explore-d9924131a4-20261128-105811
Kind:crash
Category:remark: <unknown>:0:0: unable to legalize instruction: G_STORE N:_(<8 x i1>), N:_(p0) :: (store (<8 x i1>) into @G.19) NEW M
Occurrences:1 in 1 configs, 1 test files
Snippet from:double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.8b22cfcc.b52bee257d.ll (mutant of double-convert.9733cb1e.ef308d9b.a54c1633.3407dbf1.a5226c28.b6fe42c2.3dad1bae.8b22cfcc.ll) via full input
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa,+zbs -O1 -code-model=small
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

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 i128 0
@G.18 = global i1 true
@G.19 = global <8 x i1> zeroinitializer
@G.20 = global i32 -2147483648

; 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
declare i32 @fcvt_wu_d_sat(double) #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
define signext i16 @fcvt_w_s_sat_i16(double %a) #0 {
start:
  %LGV3 = load i128, ptr @G.17, align 4
  %A4 = alloca <4 x i1>, align 1
  store <4 x i1> poison, ptr %A4, align 1
  %C = fcmp uge <4 x float> splat (float 4.200000e+01), splat (float 1.401300e-45)
  %A = alloca i1, align 1
  switch i128 %LGV3, label %SW_D4 [
    i128 11597052439180362895, label %SW_C5
  ]

BB1:                                              ; preds = %SW_C5, %SW_D4
  %LGV2 = load i64, ptr @G.10, align 4
  %LGV = load <8 x i8>, ptr @G.9, align 8
  %B7 = and i128 %LGV3, 42
  store i1 true, ptr %A, align 1
  %0 = tail call i16 @llvm.fptosi.sat.i16.f64(double %a)
  store i128 %B7, ptr @G.17, align 4
  switch i64 %LGV2, label %SW_D [
    i64 3381726621194099071, label %SW_C
  ]

BB:                                               ; preds = %SW_C, %SW_D
  %LGV1 = load <4 x i32>, ptr @G.16, align 16
  %B = fdiv double %a, 0.000000e+00
  %B3 = urem i16 %0, -1
  %C2 = fcmp one double %B, %a
  %C3 = icmp ult <4 x i32> splat (i32 1), %LGV1
  store <4 x i1> %C, ptr @G.1, align 1
  %B1 = shl <8 x i8> splat (i8 1), %LGV
  store double %B, ptr poison, align 8
  store <8 x i8> %B1, ptr @G.9, align 8
  store i1 %C2, ptr poison, align 1
  store <4 x i1> %C3, ptr %A4, align 1
  %C6 = icmp ult <8 x i8> splat (i8 127), splat (i8 16)
  store <8 x i1> %C6, ptr @G.19, align 1
  ret i16 %B3

SW_D:                                             ; preds = %BB1
  %C5 = icmp ult i32 42, 65536
  store i1 %C5, ptr %A, align 1
  %B2 = lshr <4 x i1> %C, %C
  store <4 x i1> %B2, ptr %A4, align 1
  br label %BB

SW_C:                                             ; preds = %SW_C, %BB1
  %G = getelementptr i1, ptr %A, i32 65536
  %C1 = fcmp oge double %a, %a
  store ptr %G, ptr poison, align 8
  br i1 %C1, label %BB, label %SW_C

SW_D4:                                            ; preds = %SW_D4, %start
  %LGV6 = load i1, ptr @G.18, align 1
  br i1 %LGV6, label %SW_D4, label %BB1

SW_C5:                                            ; preds = %start
  br label %BB1
}

; 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 {
  %A5 = alloca <8 x i8>, align 8
  store <8 x i8> poison, ptr %A5, align 8
  %A1 = alloca ptr, align 8
  store ptr poison, ptr %A1, align 8
  %A2 = alloca i1, align 1
  store i1 poison, ptr %A2, align 1
  %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
  store i1 false, ptr %A, align 1
  %C = fcmp true double %a, 4.940660e-324
  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
  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
  %LGV = load i32, ptr @G.20, align 4
  %B6 = mul i32 -2147483648, %LGV
  store i32 %B6, ptr %A5, align 4
  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
  %B4 = shl <8 x i8> splat (i8 127), zeroinitializer
  store <8 x i8> %B4, ptr %A5, align 8
  br label %BB1

SW_C5:                                            ; preds = %0
  %LGV9 = load i8, ptr @G.15, align 1
  %C1 = icmp ne i8 %LGV9, %LGV9
  store i1 %C1, ptr %A2, align 1
  ret i8 %LGV9

SW_C6:                                            ; preds = %0
  %G = getelementptr double, ptr %A3, i16 256
  store ptr %G, ptr %A1, align 8
  br label %BB1
}

; 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) }

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -target-abi=lp64d -mattr=+d,+f,+zicond,+zvbb,+zvkb,+zfa,+zbs -O1 -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,+zbs -O1 -code-model=small -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: G_STORE %51:_(<8 x i1>), %53:_(p0) :: (store (<8 x i1>) into @G.19) (in function: fcvt_w_s_sat_i16)
warning: Instruction selection used fallback path for fcvt_w_s_sat_i16
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,+zbs -O1 -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       0x00005601bb2d8b5b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 43
1  llc       0x00005601bb2d5b31 llvm::sys::RunSignalHandlers() + 369
2  llc       0x00005601bb2d95db
3  libc.so.6 0x00007f180a445330
4  libc.so.6 0x00007f180a49ebec pthread_kill + 284
5  libc.so.6 0x00007f180a44527e gsignal + 30
6  libc.so.6 0x00007f180a4288ff abort + 223
7  llc       0x00005601bb2313cf
8  llc       0x00005601b9951e0e
9  llc       0x00005601b9946213
10 llc       0x00005601bbbd1527 llvm::InstructionSelectImpl::selectMachineFunction(llvm::MachineFunction&) + 1255
11 llc       0x00005601bbbd2cc1 llvm::InstructionSelectLegacy::runOnMachineFunction(llvm::MachineFunction&) + 417
12 llc       0x00005601b9f51891 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 513
13 llc       0x00005601ba4ed7f7 llvm::FPPassManager::runOnFunction(llvm::Function&) + 871
14 llc       0x00005601ba4f5d12 llvm::FPPassManager::runOnModule(llvm::Module&) + 50
15 llc       0x00005601ba4ee5a0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 2000
16 llc       0x00005601b97488c9
17 llc       0x00005601b9745a53 main + 1747
18 libc.so.6 0x00007f180a42a1ca
19 libc.so.6 0x00007f180a42a28b __libc_start_main + 139
20 llc       0x00005601b9744b65 _start + 37

Occurrences (1):

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

Generated 2026-11-29 14:49 UTC.