majnemer added a subscriber: majnemer. ================ Comment at: include/llvm/Support/MathExtras.h:348 @@ -347,1 +347,3 @@ + // uint64_t to avoid UB. + return static_cast<uint64_t>(INT64_C(1) << (N - 1)) - 1; } ---------------- I'd just rewrite it as: (UINT64_C(1)<<(N-1)) - 1 https://reviews.llvm.org/D22445