fallback: translate: and i16

Run:explore-d9924131a4-20261128-105811
Kind:fallback
Category:translate: and i16 M
Occurrences:5 in 5 configs, 5 test files, 17 more counted only
Snippet from:orc-b-patterns-rv64.d8e72a41ca.ll (mutant of orc-b-patterns-rv64.ll) @narrow_i16 via llvm-extract
Config:-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zdinx -O2
Local check:reproduces at d9924131a4
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

@G.2 = external global i16

define signext i16 @narrow_i16(i16 %x) {
  %m = and i16 %x, 257
  %l = shl i16 %m, 8
  %B = sdiv i16 %x, %m
  %r = sub i16 %l, %m
  store i16 %B, ptr @G.2, align 2
  ret i16 %r
}

!llvm.dbg.cu = !{}
!llvm.module.flags = !{!0, !1}

!0 = !{i32 2, !"Dwarf Version", i32 4}
!1 = !{i32 2, !"Debug Info Version", i32 3}

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: and: '  %m = and i16 %x, 257' (in function: narrow_i16)
warning: Instruction selection used fallback path for narrow_i16

Occurrences (5):

InputFunctionConfig
cmp-zilsd-csr.66c51c8b.2fe70e6ed5.ll (mutant of cmp-zilsd-csr.66c51c8b.ll)c_expand_asm_operands-mtriple=riscv32 -verify-machineinstrs -mattr=+zve32x,+zhinx -O3
ctlz-cttz-ctpop.37f16d77b0.ll (mutant of ctlz-cttz-ctpop.ll)test_cttz_i16-mtriple=riscv64 -verify-machineinstrs -mattr=+zfinx -O3 -code-model=small
half-convert-strict.f93ca6789b.ll (mutant of half-convert-strict.ll)fcvt_h_ui-mtriple=riscv32 -verify-machineinstrs -target-abi ilp32 -disable-strictnode-mutation -mattr=+zdinx,+zhinx -O1
orc-b-patterns-rv64.d8e72a41ca.ll (mutant of orc-b-patterns-rv64.ll)narrow_i16-mtriple=riscv64 -verify-machineinstrs -mattr=+zbb,+zdinx -O2
rv32zknh-intrinsic.1427ab7f90.ll (mutant of rv32zknh-intrinsic.ll)sha256sum0_i32-mtriple=riscv32 -verify-machineinstrs -mattr=+zknh,+zdinx -O2

Generated 2026-11-29 14:49 UTC.