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

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 14:21:23 PDT 2017


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2169
+  // With Y = (uaddo A, B)
+  if (N1.getOpcode() == ISD::ADDCARRY &&
+      isNullConstant(N1.getOperand(0)) &&
----------------
This comment really isn't any use to explain what is happening here - it needs a much better explanation.

AFAICT you are saying that if (A+B) overflows then the carry can only occur in the second operand, else if (A+B) doesn't overflow it might occur in the third (carry) operand after the additional add? Can carries ever occur in both? e.g. Is addcarry/uaddo supposed to accept for i1/i2 types?


https://reviews.llvm.org/D32756





More information about the llvm-commits mailing list