]> granicus.if.org Git - llvm/commitdiff
[ValueTracking] Use APInt::isNegative(). NFC
authorCraig Topper <craig.topper@gmail.com>
Fri, 14 Apr 2017 06:43:32 +0000 (06:43 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 14 Apr 2017 06:43:32 +0000 (06:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300308 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ValueTracking.cpp

index 721c01be333aee22169de151dcb30c81c0b445a6..8479bc76c59611e8b5d269bd1f8f986927c0f229 100644 (file)
@@ -1006,7 +1006,7 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero,
         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