[llvm] [DAGCombiner] Reconstruct borrow chain from icmp pattern for USUBO_CARRY (PR #193707)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 30 02:51:30 PDT 2026
=?utf-8?q?Paweł?= Bylica <pawel at hepcolgum.band>,
=?utf-8?q?Paweł?= Bylica <pawel at hepcolgum.band>,
=?utf-8?q?Paweł?= Bylica <pawel at hepcolgum.band>,
=?utf-8?q?Paweł?= Bylica <pawel at hepcolgum.band>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/193707 at github.com>
================
@@ -3907,6 +3907,34 @@ static SDValue combineCarryDiamond(SelectionDAG &DAG, const TargetLowering &TLI,
return Merged.getValue(1);
}
+// Reconstruct a subtract-with-borrow chain from its canonicalized icmp form:
+// carry_out = or(icmp ult A, B, and(icmp eq A, B, carry_in))
+// InstCombine collapses chained usub.with.overflow intrinsics into this
+// shape, losing the direct USUBO_CARRY that the backend can chain through
+// sbb/sbcs. Fixes llvm#106118.
----------------
RKSimon wrote:
drop "Fixes llvm#106118." - we don't tend to include PR tags in code
https://github.com/llvm/llvm-project/pull/193707
More information about the llvm-commits
mailing list