fallback: translate: sub i32

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:translate: sub i32 M
Occurrences:10 in 10 configs, 7 test files, 243 more counted only
Snippet from:neg-abs.3567ebbfb3.ll (mutant of neg-abs.ll) @select_neg_abs32 via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zdinx,+zfinx -O0
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

define i32 @select_neg_abs32(i32 %x) {
  %1 = sub nsw i32 0, %x
  %B = add i32 %1, 2147483647
  ret i32 %B
}

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: sub: '  %1 = sub nsw i32 0, %x' (in function: select_neg_abs32)
warning: Instruction selection used fallback path for select_neg_abs32

Occurrences (10):

InputFunctionConfig
atomic-rmw-sub.a258139a15.ll (mutant of atomic-rmw-sub.ll)atomicrmw_sub_i32_neg-mtriple=riscv64 -verify-machineinstrs -mattr=+a,+zhinx -O0
fpenv-xlen.94c18469db.ll (mutant of fpenv-xlen.ll)func_get_fpmode-mtriple=riscv64 -verify-machineinstrs -mattr=+zfinx,+zdinx -O2
neg-abs.3567ebbfb3.ll (mutant of neg-abs.ll)select_neg_abs32-mtriple=riscv32 -verify-machineinstrs -mattr=+zbb,+zdinx,+zfinx -O0
rotl-rotr.418e9e6fba.ll (mutant of rotl-rotr.ll)rotr_64_zext-mtriple=riscv64 -verify-machineinstrs -enable-legalize-types-checking -mattr=+zfinx -O2
rotl-rotr.516911e394.ll (mutant of rotl-rotr.ll)rotr_64_zext-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx -O3
rotl-rotr.62bc06892f.ll (mutant of rotl-rotr.ll)rotr_32_mask-mtriple=riscv32 -verify-machineinstrs -mattr=+xtheadbb,+zdinx -O2
rotl-rotr.c0d68b6c1b.ll (mutant of rotl-rotr.ll)rotr_64_zext-mtriple=riscv64 -verify-machineinstrs -mattr=+zfinx -O0
rvp-avgsub.a3b90adca0.ll (mutant of rvp-avgsub.ll)sub_nuw_lshr_i32-mtriple=riscv64 -mattr=+experimental-p,+zhinx -O0 -code-model=small -verify-machineinstrs
scmp.923cd5384f.ll (mutant of scmp.ll)scmp.32.32-mtriple=riscv32 -mattr=+zhinx -O1 -code-model=small -verify-machineinstrs
short-forward-branch-opt-with-branch-with-immediates_48_ne.d0c2dfb52a.ll (mutant of short-forward-branch-opt-with-branch-with-immediates_48_ne.ll)branch_with_immSFB_lb-verify-machineinstrs -mtriple=riscv32 -mattr=+xqci,+short-forward-branch-ialu,+short-forward-branch-imul,+short-forward-branch-iload,+m,+zhinx,+zbs -O1

Generated 2026-11-29 14:49 UTC.