fallback: legalize: G_FPTRUNC s32

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:legalize: G_FPTRUNC s32 M
Occurrences:4 in 4 configs, 4 test files, 1089 more counted only
Snippet from:bfloat-imm.c075f1ddd9.ll (mutant of bfloat-imm.ll) @bfloat_negative_zero via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -O2 -code-model=medium
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G = external global bfloat
@G.1 = external global bfloat
@G.2 = external global double

; Function Attrs: nounwind
define bfloat @bfloat_negative_zero() #0 {
  %A = alloca i1, align 1
  store i1 poison, ptr %A, align 1
  %LGV2 = load double, ptr @G.2, align 8
  %LGV1 = load bfloat, ptr @G.1, align 2
  %C = fcmp ule double 1.000000e+00, %LGV2
  %LGV = load bfloat, ptr @G, align 2
  %B = frem bfloat %LGV, %LGV1
  store bfloat %B, ptr @G.1, align 2
  store i1 %C, ptr %A, align 1
  ret bfloat -0.000000e+00
}

attributes #0 = { nounwind }

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -O2 -code-model=medium -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -O2 -code-model=medium -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %10:_(bf16) = G_FPTRUNC %23:_(s32) (in function: bfloat_negative_zero)
warning: Instruction selection used fallback path for bfloat_negative_zero

Occurrences (4):

InputFunctionConfig
bfloat-imm.c075f1ddd9.ll (mutant of bfloat-imm.ll)bfloat_negative_zero-mtriple=riscv64 -verify-machineinstrs -target-abi lp64f -O2 -code-model=medium
callee-saved-fpr32s.8b6d810c90.ll (mutant of callee-saved-fpr32s.ll)callee-mtriple=riscv32 -target-abi ilp32d -verify-machineinstrs -mattr=+d -O1
unroll-loop-cse.a75147850d.ll (mutant of unroll-loop-cse.ll)unroll_loop_cse-mtriple=riscv64 -verify-machineinstrs -O0
vector-interleave-fixed.f2622a1ac9.ll (mutant of vector-interleave-fixed.ll)vector_interleave_v4bf16_v2bf16-mtriple=riscv32 -mattr=+v,+zvfh,+m -O3 -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.