We want the number of bits needed, not the power of 2.

llvm-svn: 35977
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index a35b116..d7933fc 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -693,7 +693,7 @@
   APInt tmp(sufficient, str, slen, radix);
 
   // Compute how many bits are required.
-  return isNegative + tmp.logBase2();
+  return isNegative + tmp.logBase2() + 1;
 }
 
 uint64_t APInt::getHashValue() const {