fallback: legalize: G_CTLZ <N x i8>

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:legalize: G_CTLZ <N x i8> M
Occurrences:3 in 3 configs, 1 test files, 6 more counted only
Snippet from:fixed-vectors-ctlz.c65a532ab0.ll (mutant of fixed-vectors-ctlz.ll) @ctlz_v32i8 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.2 = external global <2 x i64>

; Function Attrs: nounwind
define void @ctlz_v32i8(ptr %x, ptr %y) #0 {
  %a = load <32 x i8>, ptr %x, align 32
  %c = call <32 x i8> @llvm.ctlz.v32i8(<32 x i8> %a, i1 false)
  %B = udiv <2 x i64> splat (i64 -1), splat (i64 -9223372036854775808)
  store <32 x i8> %c, ptr %x, align 32
  store <2 x i64> %B, ptr @G.2, align 16
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <32 x i8> @llvm.ctlz.v32i8(<32 x i8>, 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: %3:_(<32 x i8>) = G_CTLZ %2:_(<32 x i8>) (in function: ctlz_v32i8)
warning: Instruction selection used fallback path for ctlz_v32i8

Occurrences (3):

InputFunctionConfig
fixed-vectors-ctlz.10ca67a269.ll (mutant of fixed-vectors-ctlz.ll)ctlz_zero_poison_v16i8-mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zve64x,+zvl128b,+zbb -O1
fixed-vectors-ctlz.7738146dc6.ll (mutant of fixed-vectors-ctlz.ll)ctlz_v16i8-mtriple=riscv32 -verify-machineinstrs -mattr=+v,+d,+zbb -O0
fixed-vectors-ctlz.c65a532ab0.ll (mutant of fixed-vectors-ctlz.ll)ctlz_v32i8-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+v,+zbb -O1

Generated 2026-11-29 14:49 UTC.