[llvm] [AArch64] fuse constant addition after sbb (PR #185117)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 09:17:39 PDT 2026


================
@@ -0,0 +1,148 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s
+;
+; Verify that ADD(SBB(Y,0,flags),C) folds to SBB(Y,-C,flags).
+; SBB(Y,0) = Y - CF; adding C gives Y - CF + C = Y - (-C) - CF = SBB(Y,-C).
+
+declare {i64, i1} @llvm.usub.with.overflow.i64(i64, i64)
+declare {i32, i1} @llvm.usub.with.overflow.i32(i32, i32)
----------------
davemgreen wrote:

Can remove these nowadays.

https://github.com/llvm/llvm-project/pull/185117


More information about the llvm-commits mailing list