]> granicus.if.org Git - llvm/commitdiff
[ValueTracking] Use uint64_t for CarryIn in computeKnownBitsAddSub instead of a creat...
authorCraig Topper <craig.topper@gmail.com>
Fri, 24 Mar 2017 05:38:09 +0000 (05:38 +0000)
committerCraig Topper <craig.topper@gmail.com>
Fri, 24 Mar 2017 05:38:09 +0000 (05:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298688 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ValueTracking.cpp

index 21c1595f094e43c4d23b6d88e97ce0987cd8b674..6f043666cefbb1dcb80c32a691ba883bd3f39a1b 100644 (file)
@@ -264,11 +264,11 @@ static void computeKnownBitsAddSub(bool Add, const Value *Op0, const Value *Op1,
   computeKnownBits(Op1, KnownZero2, KnownOne2, Depth + 1, Q);
 
   // Carry in a 1 for a subtract, rather than a 0.
-  APInt CarryIn(BitWidth, 0);
+  uint64_t CarryIn = 0;
   if (!Add) {
     // Sum = LHS + ~RHS + 1
     std::swap(KnownZero2, KnownOne2);
-    CarryIn.setBit(0);
+    CarryIn = 1;
   }
 
   APInt PossibleSumZero = ~LHSKnownZero + ~KnownZero2 + CarryIn;