fallback: legalize: G_VECREDUCE_SMAX <N x i16>

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:legalize: G_VECREDUCE_SMAX <N x i16> M
Occurrences:4 in 4 configs, 1 test files, 8 more counted only
Snippet from:fixed-vectors-reduction-int.fe05e2d576.ll (mutant of fixed-vectors-reduction-int.ll) @vreduce_smax_v16i16 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v -O0 -code-model=small
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

define i16 @vreduce_smax_v16i16(ptr %x) {
  %v = load <16 x i16>, ptr %x, align 32
  %I = insertelement <vscale x 1 x i64> splat (i64 1), i64 0, i128 18446744073709551616
  %red = call i16 @llvm.vector.reduce.smax.v16i16(<16 x i16> %v)
  store <vscale x 1 x i64> %I, ptr poison, align 8
  ret i16 %red
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.vector.reduce.smax.v16i16(<16 x i16>) #0

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %9:_(i16) = G_VECREDUCE_SMAX %1:_(<16 x i16>) (in function: vreduce_smax_v16i16)
warning: Instruction selection used fallback path for vreduce_smax_v16i16

Occurrences (4):

InputFunctionConfig
fixed-vectors-reduction-int.032dc3ab0b.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v16i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v -O1
fixed-vectors-reduction-int.a7dd883617.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v32i16-mtriple=riscv32 -verify-machineinstrs -mattr=+m,+v,+zicsr -O1
fixed-vectors-reduction-int.e0dde66053.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v128i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+zbkb -O1
fixed-vectors-reduction-int.fe05e2d576.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v16i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v -O0 -code-model=small

Generated 2026-11-29 14:49 UTC.