Revert "[llvm-profdata] Add SaturatingAdd/SaturatingMultiply Helper Functions"
[oota-llvm.git] / include / llvm / Support / MathExtras.h
index 71b22b0f2fcf2b67adf10aab6eb38d060195ffa9..2c515bbd242a13b725b37c5ad30ad4478a836418 100644 (file)
@@ -313,7 +313,7 @@ inline bool isShiftedUInt(uint64_t x) {
 /// isUIntN - Checks if an unsigned integer fits into the given (dynamic)
 /// bit width.
 inline bool isUIntN(unsigned N, uint64_t x) {
-  return x == (x & (~0ULL >> (64 - N)));
+  return N >= 64 || x < (UINT64_C(1)<<(N));
 }
 
 /// isIntN - Checks if an signed integer fits into the given (dynamic)