fallback: legalize: G_CTLZ <N x i16>

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:legalize: G_CTLZ <N x i16> M
Occurrences:4 in 3 configs, 1 test files, 3 more counted only
Snippet from:fixed-vectors-ctlz.c65a532ab0.ll (mutant of fixed-vectors-ctlz.ll) @ctlz_zero_poison_v8i16 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+zbb -O1
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G.3 = external global <2 x i64>
@G.4 = external global <2 x i64>

; Function Attrs: nounwind
define void @ctlz_zero_poison_v8i16(ptr %x, ptr %y) #0 {
  %LGV = load <2 x i64>, ptr @G.3, align 16
  %B = xor <2 x i64> splat (i64 -1), %LGV
  %a = load <8 x i16>, ptr %x, align 16
  %c = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %a, i1 true)
  store <8 x i16> %c, ptr %x, align 16
  store <2 x i64> %B, ptr @G.4, align 16
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1 immarg) #1

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %8:_(<8 x i16>) = G_CTLZ %7:_(<8 x i16>) (in function: ctlz_zero_poison_v8i16)
warning: Instruction selection used fallback path for ctlz_zero_poison_v8i16

Occurrences (4):

InputFunctionConfig
fixed-vectors-ctlz.7738146dc6.ll (mutant of fixed-vectors-ctlz.ll)ctlz_v16i16-mtriple=riscv32 -verify-machineinstrs -mattr=+v,+d,+zbb -O0
fixed-vectors-ctlz.7738146dc6.ll (mutant of fixed-vectors-ctlz.ll)ctlz_zero_poison_v8i16-mtriple=riscv32 -verify-machineinstrs -mattr=+v,+d,+zbb -O0
fixed-vectors-ctlz.c65a532ab0.ll (mutant of fixed-vectors-ctlz.ll)ctlz_zero_poison_v8i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+zbb -O1
fixed-vectors-ctlz.ffd4632b17.ll (mutant of fixed-vectors-ctlz.ll)ctlz_zero_poison_v16i16-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+d,+zbb,+zcb -O1

Generated 2026-11-29 14:49 UTC.