fallback: legalize: G_VECREDUCE_ADD <N x i1>

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:legalize: G_VECREDUCE_ADD <N x i1> M
Occurrences:3 in 3 configs, 2 test files, 23 more counted only
Snippet from:fixed-vectors-vreductions-mask.92088d4c30.ll (mutant of fixed-vectors-vreductions-mask.ll) @vreduce_add_v32i1 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+m -O0 -code-model=medium
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G = external global i32

define zeroext i1 @vreduce_add_v32i1(<32 x i1> %v) {
  %LGV = load i32, ptr @G, align 4
  %I = insertelement <32 x i1> %v, i1 true, i32 %LGV
  %red = call i1 @llvm.vector.reduce.add.v32i1(<32 x i1> %I)
  ret i1 %red
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.vector.reduce.add.v32i1(<32 x i1>) #0

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

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m -O0 -code-model=medium -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -verify-machineinstrs -mattr=+m -O0 -code-model=medium -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %7:_(i1) = G_VECREDUCE_ADD %4:_(<32 x i1>) (in function: vreduce_add_v32i1)
warning: Instruction selection used fallback path for vreduce_add_v32i1

Occurrences (3):

InputFunctionConfig
fixed-vectors-reduction-mask-vp.d69d59ce47.ll (mutant of fixed-vectors-reduction-mask-vp.ll)vpreduce_add_v8i1-mtriple=riscv32 -verify-machineinstrs -mattr=+zicond -O2
fixed-vectors-vreductions-mask.92088d4c30.ll (mutant of fixed-vectors-vreductions-mask.ll)vreduce_add_v32i1-mtriple=riscv64 -verify-machineinstrs -mattr=+m -O0 -code-model=medium
fixed-vectors-vreductions-mask.b25c88d284.ll (mutant of fixed-vectors-vreductions-mask.ll)vreduce_add_v4i1-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v -O0

Generated 2026-11-29 14:49 UTC.