Even if we don't have any known bits, we can assume that there is
1 at least 1 sign bit. This is consistent with ComputeNumSignBits
which always returns at least.
Add KnownBits::countMaxSignedBits() which computes the number of
bits needed to represent all signed values with those known bits.
Split from D116469.
The name doesn't read clearly to me. Does this seem better?
/// Returns the maximum number of bits needed to represent all possible /// signed values with these known bits. This is the inverse of the minimum /// number of known sign bits. Examples for bitwidth 5: /// 110?? --> 4 /// 0000? --> 2 unsigned countMaxSignificantBits() const {I thought this was what countMaxActiveBits() returns, so we should put a comment on that too to avoid confusion.
The "significant" terminology would be similar to a change in D20275.