[llvm] r368701 - [TargetLowering][NFC] prepareUREMEqFold(): fixup comment

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 07:57:08 PDT 2019


Author: lebedevri
Date: Tue Aug 13 07:57:08 2019
New Revision: 368701

URL: http://llvm.org/viewvc/llvm-project?rev=368701&view=rev
Log:
[TargetLowering][NFC] prepareUREMEqFold(): fixup comment

The comment initially matched the code, but the code was incorrect
and was fixed after the initial revert back back when it was introduced,
but the comment was never updated.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=368701&r1=368700&r2=368701&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Tue Aug 13 07:57:08 2019
@@ -4866,7 +4866,7 @@ TargetLowering::prepareUREMEqFold(EVT SE
   // fold (seteq/ne (urem N, D), 0) -> (setule/ugt (rotr (mul N, P), K), Q)
   // - D must be constant, with D = D0 * 2^K where D0 is odd
   // - P is the multiplicative inverse of D0 modulo 2^W
-  // - Q = floor((2^W - 1) / D0)
+  // - Q = floor(((2^W) - 1) / D)
   // where W is the width of the common type of N and D.
   assert((Cond == ISD::SETEQ || Cond == ISD::SETNE) &&
          "Only applicable for (in)equality comparisons.");




More information about the llvm-commits mailing list