fallback: legalize: G_CTLZ <N x i64>

Run:explore-db12fc36f6-20261127-115111
Kind:fallback
Category:legalize: G_CTLZ <N x i64> M
Occurrences:3 in 3 configs, 1 test files, 2 more counted only
Snippet from:fixed-vectors-ctlz.1db17c5352.ll (mutant of fixed-vectors-ctlz.ll) @ctlz_v4i64 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+zve64x,+zvl128b,+zfhmin,+zbb -O2
Local check:reproduces at db12fc36f6
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G = external global i8

; Function Attrs: nounwind
define void @ctlz_v4i64(ptr %x, ptr %y) #0 {
  %LGV = load i8, ptr @G, align 1
  %a = load <4 x i64>, ptr %x, align 32
  %c = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> %a, i1 false)
  store <4 x i64> %c, ptr %x, align 32
  %B = sdiv i8 %LGV, 42
  store i8 %B, ptr poison, align 1
  ret void
}

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

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to legalize instruction: %5:_(<4 x i64>) = G_CTLZ %4:_(<4 x i64>) (in function: ctlz_v4i64)
warning: Instruction selection used fallback path for ctlz_v4i64

Occurrences (3):

InputFunctionConfig
fixed-vectors-ctlz.1db17c5352.ll (mutant of fixed-vectors-ctlz.ll)ctlz_v4i64-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+zve64x,+zvl128b,+zfhmin,+zbb -O2
fixed-vectors-ctlz.95d3d44040.ll (mutant of fixed-vectors-ctlz.ll)ctlz_zero_poison_v2i64-mtriple=riscv32 -verify-machineinstrs -mattr=+v,+zvbb,+zbb,+zihintpause -O3 -code-model=medium
fixed-vectors-ctlz.e4b5dfcc77.ll (mutant of fixed-vectors-ctlz.ll)ctlz_v2i64-mtriple=riscv32 -verify-machineinstrs -mattr=+v,+zbb -O2

Generated 2026-11-29 14:49 UTC.