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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 31 10:50:05 PDT 2019


craig.topper marked an inline comment as done.
craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3049
+    return DAG.getNode(ISD::SADDO, DL, N->getVTList(), N0,
+                       DAG.getConstant(-N1C->getAPIntValue(), DL, VT));
+  }
----------------
RKSimon wrote:
> 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....
I think you're right. This generates the opposite value for the overflow flag for INT_MIN.


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

https://reviews.llvm.org/D60020





More information about the llvm-commits mailing list