We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba5afe5 commit b85395fCopy full SHA for b85395f
llvm/include/llvm/ADT/APInt.h
@@ -1615,11 +1615,7 @@ class LLVM_NODISCARD APInt {
1615
/// returns the smallest bit width that will retain the negative value. For
1616
/// example, -1 can be written as 0b1 or 0xFFFFFFFFFF. 0b1 is shorter and so
1617
/// for -1, this function will always return 1.
1618
- unsigned getMinSignedBits() const {
1619
- if (isNegative())
1620
- return BitWidth - countLeadingOnes() + 1;
1621
- return getActiveBits() + 1;
1622
- }
+ unsigned getMinSignedBits() const { return BitWidth - getNumSignBits() + 1; }
1623
1624
/// Get zero extended value
1625
///
0 commit comments