fallback: translate: call llvm.cttz.i32

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:translate: call llvm.cttz.i32 M
Occurrences:10 in 8 configs, 5 test files, 13 more counted only
Snippet from:shl-cttz.6bcac28731.ll (mutant of shl-cttz.ll) @shl_cttz_i32 via llvm-extract
Config:-mtriple=riscv64 -mattr=+zdinx -O2 -code-model=small -verify-machineinstrs
Local check:reproduces at d9924131a4
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)
  %B = or i32 %cttz, 0
  %res = shl i32 %B, %cttz
  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=+zdinx -O2 -code-model=small -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -mattr=+zdinx -O2 -code-model=small -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
ctlz-cttz-ctpop.0cb7fd1909.ll (mutant of ctlz-cttz-ctpop.ll)test_cttz_i32-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zhinx -O0
ctz_zero_return_test.413d8a21e7.ll (mutant of ctz_zero_return_test.ll)ctz2-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx -O0
ctz_zero_return_test.413d8a21e7.ll (mutant of ctz_zero_return_test.ll)ctz6-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx -O0
ctz_zero_return_test.6ad99fb11b.ll (mutant of ctz_zero_return_test.ll)ctz1-mtriple=riscv32 -verify-machineinstrs -mattr=+a,+zdinx -O3
ctz_zero_return_test.9869af0b7e.ll (mutant of ctz_zero_return_test.ll)ctz6-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zfinx -O3
ctz_zero_return_test.e1d12ade09.ll (mutant of ctz_zero_return_test.ll)ctz1-mtriple=riscv32 -verify-machineinstrs -mattr=+zvkb,+zdinx -O1
ctz_zero_return_test.e1d12ade09.ll (mutant of ctz_zero_return_test.ll)ctz1_flipped-mtriple=riscv32 -verify-machineinstrs -mattr=+zvkb,+zdinx -O1
rv32xtheadbb.1ac49c7932.ll (mutant of rv32xtheadbb.ll)cttz_i32-mtriple=riscv32 -mattr=+zfinx -O0 -verify-machineinstrs
rv32xtheadbb.4862e71ba3.ll (mutant of rv32xtheadbb.ll)cttz_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zihintpause,+zdinx -O0
shl-cttz.6bcac28731.ll (mutant of shl-cttz.ll)shl_cttz_i32-mtriple=riscv64 -mattr=+zdinx -O2 -code-model=small -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.