fallback: translate: call llvm.ctpop.i32

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:translate: call llvm.ctpop.i32 M
Occurrences:3 in 3 configs, 2 test files, 19 more counted only
Snippet from:rv32zbb.21c9eed8a7.ll (mutant of rv32zbb.ll) @ctpop_i32 via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zvbb,+zfinx -O2
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G.1 = external global i32

; Function Attrs: nounwind
define i32 @ctpop_i32(i32 %a) #0 {
  %1 = call i32 @llvm.ctpop.i32(i32 %a)
  %B = add i32 %1, %1
  store i32 %B, ptr @G.1, align 4
  ret i32 %1
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #1

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

Reproduce:

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

Local llc output:

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

Occurrences (3):

InputFunctionConfig
rv32zbb.21c9eed8a7.ll (mutant of rv32zbb.ll)ctpop_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zvbb,+zfinx -O2
rv64zbb.17700dc0e6.ll (mutant of rv64zbb.ll)ctpop32_eq_one_maybezero-mtriple=riscv64 -verify-machineinstrs -mattr=+zdinx,+xtheadba -O2 -code-model=medium
rv64zbb.39752cd0df.ll (mutant of rv64zbb.ll)ctpop_i32_ugt_one-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zdinx,+a -O0

Generated 2026-11-29 14:49 UTC.