Author: lattner Date: Wed Aug 29 11:21:18 2007 New Revision: 41566 URL: http://llvm.org/viewvc/llvm-project?rev=41566&view=rev Log: getMinSignedBits needs to take into consider the sign bit when the value is positive.
Modified: llvm/trunk/include/llvm/ADT/APInt.h Modified: llvm/trunk/include/llvm/ADT/APInt.h URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=41566&r1=41565&r2=41566&view=diff ============================================================================== --- llvm/trunk/include/llvm/ADT/APInt.h (original) +++ llvm/trunk/include/llvm/ADT/APInt.h Wed Aug 29 11:21:18 2007 @@ -856,7 +856,7 @@ inline uint32_t getMinSignedBits() const { if (isNegative()) return BitWidth - countLeadingOnes() + 1; - return getActiveBits(); + return getActiveBits()+1; } /// This method attempts to return the value of this APInt as a zero extended _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits