In both of these cases, the arguments to Log2_32_Ceil are known to be
nonzero.
unsigned BitWidth = getSizeInBits();
if (BitWidth <= 8)
return EVT(MVT::i8);
- return getIntegerVT(Context, 1 << Log2_32_Ceil(BitWidth));
+ return getIntegerVT(Context, llvm::bit_ceil(BitWidth));
}
/// Finds the smallest simple value type that is greater than or equal to
// Skip known-zero high parts of the operand.
int64_t OrigBitSize = VT.getSizeInBits();
- int64_t BitSize = (int64_t)1 << Log2_32_Ceil(NumSignificantBits);
+ int64_t BitSize = llvm::bit_ceil(NumSignificantBits);
BitSize = std::min(BitSize, OrigBitSize);
// The POPCNT instruction counts the number of bits in each byte.