[llvm] r300308 - [ValueTracking] Use APInt::isNegative(). NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 13 23:43:32 PDT 2017


Author: ctopper
Date: Fri Apr 14 01:43:32 2017
New Revision: 300308

URL: http://llvm.org/viewvc/llvm-project?rev=300308&view=rev
Log:
[ValueTracking] Use APInt::isNegative(). NFC

Modified:
    llvm/trunk/lib/Analysis/ValueTracking.cpp

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=300308&r1=300307&r2=300308&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Fri Apr 14 01:43:32 2017
@@ -1006,7 +1006,7 @@ static void computeKnownBitsFromOperator
         MaxHighZeros = std::max(KnownZero.countLeadingOnes(),
                                 KnownZero2.countLeadingOnes());
       // If either side is negative, the result is negative.
-      else if (KnownOne[BitWidth - 1] || KnownOne2[BitWidth - 1])
+      else if (KnownOne.isNegative() || KnownOne2.isNegative())
         MaxHighOnes = 1;
     } else if (SPF == SPF_UMAX) {
       // We can derive a lower bound on the result by taking the max of the




More information about the llvm-commits mailing list