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

Tim Gymnich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 02:52:44 PDT 2019


TG908 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
----------------
foad wrote:
> 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?
It is required when:
- we have both a rem and a div node and we want to combine them.
- for rem operations on integer types greater than half the max register width.


================
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.
----------------
foad wrote:
> Why "same comparison result"? Do you mean "same result"?
yes


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

https://reviews.llvm.org/D68360





More information about the llvm-commits mailing list