From: Chris Lattner Date: Wed, 29 Aug 2007 16:21:18 +0000 (+0000) Subject: getMinSignedBits needs to take into consider the sign bit when the value is positive. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=cd3c4cac6ea3ce3bff0ce763d45c3f7a2d673178;p=oota-llvm.git getMinSignedBits needs to take into consider the sign bit when the value is positive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41566 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ADT/APInt.h b/include/llvm/ADT/APInt.h index 0102d67e07e..9a5643bfc5e 100644 --- a/include/llvm/ADT/APInt.h +++ b/include/llvm/ADT/APInt.h @@ -856,7 +856,7 @@ public: 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