fallback: translate: call llvm.cttz.i32

Run:explore-db12fc36f6-20261127-115111
Kind:fallback
Category:translate: call llvm.cttz.i32 M
Occurrences:10 in 10 configs, 6 test files, 9 more counted only
Snippet from:shl-cttz.73ab93622c.ll (mutant of shl-cttz.ll) @shl_cttz_i32 via llvm-extract
Config:-mtriple=riscv64 -mattr=+m,+zdinx,+a -O3 -verify-machineinstrs
Local check:reproduces at db12fc36f6
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

define i32 @shl_cttz_i32(i32 %x, i32 %y) {
entry:
  %cttz = call i32 @llvm.cttz.i32(i32 %y, i1 true)
  %res = shl i32 %cttz, %x
  %C = icmp ugt i32 %cttz, %res
  store i1 %C, ptr poison, align 1
  ret i32 %res
}

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

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: call llvm.cttz.i32: '  %cttz = call i32 @llvm.cttz.i32(i32 %y, i1 true)' (in function: shl_cttz_i32)
warning: Instruction selection used fallback path for shl_cttz_i32

Occurrences (10):

InputFunctionConfig
ctz_zero_return_test.4ff1e72814.ll (mutant of ctz_zero_return_test.ll)ctz5-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx -O1
ctz_zero_return_test.77dcb3d55d.ll (mutant of ctz_zero_return_test.ll)ctz1_flipped-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zdinx,+zhinx -O1
ctz_zero_return_test.b7768b1a12.ll (mutant of ctz_zero_return_test.ll)ctz5-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zfinx,+zhinx -O2 -code-model=small
rv64xtheadbb.4b645f4083.ll (mutant of rv64xtheadbb.ll)cttz_zero_poison_i32-mtriple=riscv64 -mattr=+xtheadbb,+zfinx -O2 -verify-machineinstrs
rv64xtheadbb.6e47dbb07b.ll (mutant of rv64xtheadbb.ll)findFirstSet_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+xtheadbb,+zdinx,+xtheadba -O1
rv64zbb.18852b9661.ll (mutant of rv64zbb.ll)cttz_zero_poison_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zdinx -O0
rv64zbb.d8d761a3fc.ll (mutant of rv64zbb.ll)findFirstSet_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zfinx -O0
shl-cttz.50767b167f.ll (mutant of shl-cttz.ll)shl_cttz_constant_i32-mtriple=riscv64 -mattr=+m,+zbb,+zbkb,+zhinx -O3 -code-model=small -verify-machineinstrs
shl-cttz.73ab93622c.ll (mutant of shl-cttz.ll)shl_cttz_i32-mtriple=riscv64 -mattr=+m,+zdinx,+a -O3 -verify-machineinstrs
shl-cttz.e5c7e3dc1e.ll (mutant of shl-cttz.ll)shl_cttz_i32_zero_is_defined-mtriple=riscv32 -mattr=+m,+zbb,+a,+zhinx -O3 -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.