[PATCH] D57302: [DAGCombine] More diamond carry pattern optimization.

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 09:56:38 PDT 2019


niravd added a comment.

Should we have the corresponding subcarry case folded in here as well?

Also, do we have a test case where we're adding/subtracting 3 or more multi-register numbers?



================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2779
+  }
+
+  // We couldn't find a suitable Z.
----------------
nit: make the failing case here an else clause.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2812
+    return cancelDiamond(Carry0.getOperand(0), Carry1.getOperand(1));
+  } else if (Carry1.getOperand(1) == Carry0.getValue(0)) {
+    return cancelDiamond(Carry1.getOperand(0), Carry0.getOperand(0));
----------------
Remove the else for consistency.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57302/new/

https://reviews.llvm.org/D57302





More information about the llvm-commits mailing list