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

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 02:29:09 PDT 2019


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3929
+  }
+
   // If X/C can be simplified by the division-by-constant logic, lower
----------------
Is the "lower X%C to the equivalent of X-X/C*C" code below obsolete now, or is it still required in some cases?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3962
+/// Given an ISD::UREM where the divisor is constant,
+/// return a DAG expression that will generate the same comparison result
+/// using only multiplications, additions and shifts.
----------------
Why "same comparison result"? Do you mean "same result"?


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:4061
+/// Given an ISD::SREM where the divisor is constant,
+/// return a DAG expression that will generate the same comparison result
+/// using only multiplications, additions and shifts.
----------------
Ditto.


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

https://reviews.llvm.org/D68360





More information about the llvm-commits mailing list