fallback: translate: srem i64

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:translate: srem i64 M
Occurrences:5 in 5 configs, 5 test files, 28 more counted only
Snippet from:shl-cttz.3883f91716.ll (mutant of shl-cttz.ll) @shl_cttz_constant_i64 via llvm-extract
Config:-mtriple=riscv64 -mattr=+zfinx -O1 -verify-machineinstrs
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G.1 = external global i64

define i64 @shl_cttz_constant_i64(i64 %y) {
entry:
  %B = srem i64 %y, -1
  %cttz = call i64 @llvm.cttz.i64(i64 %y, i1 true)
  %res = shl i64 4, %cttz
  store i64 %B, ptr @G.1, align 4
  ret i64 %res
}

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

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

Reproduce:

llc -mtriple=riscv64 -mattr=+zfinx -O1 -verify-machineinstrs -global-isel -global-isel-abort=2 -pass-remarks-missed=gisel.* snippet.ll -o -
llc -mtriple=riscv64 -mattr=+zfinx -O1 -verify-machineinstrs -global-isel=0 snippet.ll -o -

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: srem: '  %B = srem i64 %y, -1' (in function: shl_cttz_constant_i64)
warning: Instruction selection used fallback path for shl_cttz_constant_i64

Occurrences (5):

InputFunctionConfig
bswap-bitreverse.a52eedb374.ll (mutant of bswap-bitreverse.ll)test_bitreverse_i7-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zfinx -O0
half-arith-strict.c0f2c673dd.ll (mutant of half-arith-strict.ll)fnmsub_h_2-mtriple=riscv32 -verify-machineinstrs -disable-strictnode-mutation -target-abi ilp32 -mattr=+zhinx,+zbb -O1 -code-model=small
half-convert-strict.740a1528b6.ll (mutant of half-convert-strict.ll)fcvt_wu_h-mtriple=riscv64 -verify-machineinstrs -target-abi lp64 -disable-strictnode-mutation -mattr=+zhinxmin -O2
rv64zksh-intrinsic-autoupgrade.a6fae54596.ll (mutant of rv64zksh-intrinsic-autoupgrade.ll)sm3p0_i64-mtriple=riscv64 -verify-machineinstrs -mattr=+zksh,+zdinx,+zfinx -O3
shl-cttz.3883f91716.ll (mutant of shl-cttz.ll)shl_cttz_constant_i64-mtriple=riscv64 -mattr=+zfinx -O1 -verify-machineinstrs

Generated 2026-11-29 14:49 UTC.