fallback: translate: call llvm.usub.with.overflow.i32

Run:explore-b577f07195-20261129-105236
Kind:fallback
Category:translate: call llvm.usub.with.overflow.i32 M
Occurrences:6 in 6 configs, 2 test files, 2 more counted only
Snippet from:arith-with-overflow.5dd8c59015.ll (mutant of arith-with-overflow.ll) @usub via llvm-extract
Config:-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx,+m -O3
Local check:reproduces at b577f07195
Compiler Explorer:not uploaded (over --godbolt-limit or disabled)

Snippet:

; Function Attrs: nounwind
define i1 @usub(i32 %a, i32 %b, ptr %c) #0 {
entry:
  %x = call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %a, i32 %b)
  %calc = extractvalue { i32, i1 } %x, 0
  %ovf = extractvalue { i32, i1 } %x, 1
  store i32 %calc, ptr %c, align 4
  br label %BB

BB:                                               ; preds = %entry
  ret i1 %ovf
}

; Function Attrs: nocallback nocreateundeforpoison nofree nosync nounwind speculatable willreturn memory(none)
declare { i32, i1 } @llvm.usub.with.overflow.i32(i32, i32) #1

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

Reproduce:

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

Local llc output:

remark: <unknown>:0:0: unable to translate instruction: call llvm.usub.with.overflow.i32: '  %x = call { i32, i1 } @llvm.usub.with.overflow.i32(i32 %a, i32 %b)' (in function: usub)
warning: Instruction selection used fallback path for usub

Occurrences (6):

InputFunctionConfig
arith-with-overflow.37403a50f6.ll (mutant of arith-with-overflow.ll)usub-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx,+zicsr -O1
arith-with-overflow.5dd8c59015.ll (mutant of arith-with-overflow.ll)usub-mtriple=riscv32 -verify-machineinstrs -mattr=+zdinx,+m -O3
arith-with-overflow.fbd8bc9961.ll (mutant of arith-with-overflow.ll)usub-mtriple=riscv32 -verify-machineinstrs -mattr=+zicsr,+zhinx -O2
xaluo.713608171d.ll (mutant of xaluo.ll)usubo.select.i32-mtriple=riscv32 -verify-machineinstrs -mattr=+m,+zba,+zhinx,+zicond -O3
xaluo.8c37428828.ll (mutant of xaluo.ll)usubo.not.i32-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+zba,+zhinx -O2
xaluo.ad8fa0b6a7.ll (mutant of xaluo.ll)usubo.select.i32-mtriple=riscv64 -verify-machineinstrs -mattr=+m,+zba,+zdinx -O3

Generated 2026-11-29 14:49 UTC.