[PATCH] D60020: [DAGCombiner][X86] Canonicalize SSUBO with immediate RHS to SADDO by negating the immediate.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 31 00:57:52 PDT 2019


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3046
+
+  // fold (subox, c) -> (addo x, -c)
+  if (IsSigned && N1C) {
----------------
(subo x, c)


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3049
+    return DAG.getNode(ISD::SADDO, DL, N->getVTList(), N0,
+                       DAG.getConstant(-N1C->getAPIntValue(), DL, VT));
+  }
----------------
Might be wrong here, but what happens with (subo x, INT_MIN) ? That can't be expressed as a +ve integer and we're dealing with overflows here....


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

https://reviews.llvm.org/D60020





More information about the llvm-commits mailing list