[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)
llvm-svn: 300308

llvm/lib/Analysis/ValueTracking.cpp

index 721c01b..8479bc7 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