[PATCH] D68360: PR41162 Implement LKK remainder and divisibility algorithms

Tim Gymnich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 6 05:32:36 PDT 2019


TG908 marked an inline comment as done.
TG908 added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3920-3922
+      SDNode *DivNode =
+          DAG.getNodeIfExists(DivOpcode, N->getVTList(), {N0, N1});
+      if (!DivNode) {
----------------
lebedev.ri wrote:
> Not everything has div-rem operation, this check should only be done if said op exists.
> That being said, i'm not sure this check should be here, `DAGCombiner::visitSDIV()` already
> has `// sdiv, srem -> sdivrem` fold.
This is also used to combine div and rem operations. This can be done with a `divrem` operation or by using the Granlund-Montgomery-Warren approach.


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

https://reviews.llvm.org/D68360





More information about the llvm-commits mailing list