[PATCH] D70079: [SelectionDAG] Combine U{ADD,SUB}O diamonds into {ADD,SUB}CARRY

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 07:31:55 PST 2019


RKSimon added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2823
+static SDValue combineCarryDiamond(SelectionDAG &DAG, SDValue Carry0,
+                                   SDValue Carry1, SDNode *N) {
+  if (Carry0.getResNo() != 1 || Carry1.getResNo() != 1)
----------------
davezarzycki wrote:
> RKSimon wrote:
> > We handle OR and XOR here but I don't see anything that treats them differently.
> That's because it doesn't matter in this scenario. Either (uaddo A, B) overflows, or (uaddo *, In) overflows, but they cannot both overflow. I can add a comment about this if you want.
yes please - your diagram doesn't mention xor at all


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70079





More information about the llvm-commits mailing list