[llvm] [AArch64][DAG] Port adde and sube combine to AArch64 (PR #202227)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 10:48:44 PDT 2026


================
@@ -22867,6 +22867,41 @@ static SDValue foldADCToCINC(SDNode *N, SelectionDAG &DAG) {
   return DAG.getNode(AArch64ISD::CSINC, DL, VT, LHS, LHS, CC, Cond);
 }
 
+static SDValue performAddSubCarryCombine(SDNode *N, SelectionDAG &DAG) {
+  SDValue RHS = N->getOperand(1);
+  if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(RHS)) {
+    int64_t Imm = C->getSExtValue();
+    if (Imm < 0) {
----------------
zip-stack-debug wrote:

I copied this from ARM's backend. Though, it is probable that this issue exists there too. 

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


More information about the llvm-commits mailing list