[PATCH] D32756: [DAGCombine] Refactor common addcarry pattern.

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 10:17:03 PDT 2017


deadalnix added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2188
+      CarryIn.getOpcode() == ISD::ADDCARRY &&
+      isNullConstant(CarryIn.getOperand(1))) {
+    auto Y = CarryIn.getOperand(0);
----------------
filcab wrote:
> deadalnix wrote:
> > filcab wrote:
> > > Shouldn't we allow both `(addcarry *, 0, Z)` and `(addcarry 0, *, Z)`?
> > > Same for the final one, we could have X+0(+C) or 0+X(+C), no?
> > The method is called with argument in both order already. See line 2146 onward.
> Should take care of the final addcarry, yes. But it's still missing the one above (*+0+Z), no?
Constants are canonicalized on the RHS so it's fine.


https://reviews.llvm.org/D32756





More information about the llvm-commits mailing list