fallback: translate: call llvm.ctlz.i32

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:translate: call llvm.ctlz.i32 M
Occurrences:3 in 3 configs, 3 test files, 3 more counted only
Snippet from:rv32zbb.4550702ed5.ll (mutant of rv32zbb.ll) @ctlz_i32 via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+xtheadba,+zdinx -O0
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

; Function Attrs: nounwind
define i32 @ctlz_i32(i32 %a) #0 {
  %1 = call i32 @llvm.ctlz.i32(i32 %a, i1 false)
  %B = fadd half 6.550400e+04, +inf
  store half %B, ptr poison, align 2
  ret i32 %1
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctlz.i32(i32, i1 immarg) #1

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

Reproduce:

llc -mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+xtheadba,+zdinx -O0 -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+xtheadba,+zdinx -O0 -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: call llvm.ctlz.i32: '  %1 = call i32 @llvm.ctlz.i32(i32 %a, i1 false)' (in function: ctlz_i32)
warning: Instruction selection used fallback path for ctlz_i32

Occurrences (3):

InputFunctionConfig
ctlz-cttz-ctpop.ebd65ece67.ll (mutant of ctlz-cttz-ctpop.ll)test_ctlz_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zba,+zdinx -O0
rv32zbb.4550702ed5.ll (mutant of rv32zbb.ll)ctlz_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+xtheadba,+zdinx -O0
rv64xtheadbb.17e7422636.ll (mutant of rv64xtheadbb.ll)log2_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+xtheadbb,+b,+zhinx -O0 -code-model=medium

Generated 2026-11-29 14:49 UTC.