fallback: translate: ashr i64

Run:explore-db12fc36f6-20261127-115111
Kind:fallback
Category:translate: ashr i64 M
Occurrences:5 in 5 configs, 4 test files, 34 more counted only
Snippet from:rv64p.3ba07c61f1.ll (mutant of rv64p.ll) @cls_i64_2 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zhinx -O3
Local check:reproduces at db12fc36f6
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

define i64 @cls_i64_2(i64 %x) {
  %a = ashr i64 %x, 63
  %b = xor i64 %x, %a
  %B = sdiv i64 %b, %x
  %c = shl i64 %B, 1
  %d = or i64 %c, 1
  %e = call i64 @llvm.ctlz.i64(i64 %d, i1 true)
  ret i64 %e
}

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

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: ashr: '  %a = ashr i64 %x, 63' (in function: cls_i64_2)
warning: Instruction selection used fallback path for cls_i64_2

Occurrences (5):

InputFunctionConfig
double-intrinsics.f39bb24283.ll (mutant of double-intrinsics.ll)isnan_d_fpclass-mtriple=riscv64 -verify-machineinstrs -target-abi=lp64 -mattr=+zdinx -O1
float-convert-strict.acefa75836.ll (mutant of float-convert-strict.ll)fcvt_s_wu_i8-mtriple=riscv64 -verify-machineinstrs -disable-strictnode-mutation -target-abi=lp64 -mattr=+zfinx,+zbb -O0
half-convert-strict.780314befc.ll (mutant of half-convert-strict.ll)fcvt_h_d-mtriple=riscv64 -verify-machineinstrs -target-abi lp64 -disable-strictnode-mutation -mattr=+zdinx,+zhinx,+m -O2
rv64p.3ba07c61f1.ll (mutant of rv64p.ll)cls_i64_2-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zhinx -O3
rv64p.3cf2763fb1.ll (mutant of rv64p.ll)cls_i64_2-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zhinx -O1

Generated 2026-11-29 14:49 UTC.