fallback: legalize: G_VECREDUCE_SMAX <N x i16>

Run:explore-db12fc36f6-20261127-115111
Kind:fallback
Category:legalize: G_VECREDUCE_SMAX <N x i16> M
Occurrences:6 in 6 configs, 2 test files, 4 more counted only
Snippet from:fixed-vectors-reduction-int-vp.38a38f4564.ll (mutant of fixed-vectors-reduction-int-vp.ll) @vpreduce_smax_v2i16 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -O3
Local check:reproduces at db12fc36f6
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G = external global <2 x i1>

define signext i16 @vpreduce_smax_v2i16(i16 signext %s, <2 x i16> %v, <2 x i1> %m, i32 zeroext %evl) {
  %LGV = load <2 x i1>, ptr @G, align 1
  %B = shl <2 x i1> %m, %LGV
  %r = call i16 @llvm.vp.reduce.smax.v2i16(i16 %s, <2 x i16> %v, <2 x i1> %B, i32 %evl)
  ret i16 %r
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.vp.reduce.smax.v2i16(i16, <2 x i16>, <2 x i1>, i32) #0

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

Reproduce:

llc -mtriple=riscv64 -verify-machineinstrs -O3 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -verify-machineinstrs -O3 -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %31:_(i16) = G_VECREDUCE_SMAX %28:_(<2 x i16>) (in function: vpreduce_smax_v2i16)
warning: Instruction selection used fallback path for vpreduce_smax_v2i16

Occurrences (6):

InputFunctionConfig
fixed-vectors-reduction-int-vp.38a38f4564.ll (mutant of fixed-vectors-reduction-int-vp.ll)vpreduce_smax_v2i16-mtriple=riscv64 -verify-machineinstrs -O3
fixed-vectors-reduction-int.00f60171a6.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v64i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m -O1
fixed-vectors-reduction-int.0344bbedea.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v4i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+zvkb -O3
fixed-vectors-reduction-int.49632b58b4.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v8i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+zicond -O2
fixed-vectors-reduction-int.9fa42ca646.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v8i16-mtriple=riscv32 -verify-machineinstrs -O0
fixed-vectors-reduction-int.cd7769971e.ll (mutant of fixed-vectors-reduction-int.ll)vreduce_smax_v2i16-mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zcb -O3

Generated 2026-11-29 14:49 UTC.