From: Roman Lebedev Date: Tue, 13 Aug 2019 14:57:08 +0000 (+0000) Subject: [TargetLowering][NFC] prepareUREMEqFold(): fixup comment X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7279f838cb0cfe6ca82a1fe1748edfebc82ba57;p=llvm [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368701 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index f373eee469b..eb39c2523e1 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -4866,7 +4866,7 @@ TargetLowering::prepareUREMEqFold(EVT SETCCVT, SDValue REMNode, // 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.");