mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
[KnownBits] isNonZero() - avoid expensive countPopulation call. NFC.
We can just check for a null value.
This commit is contained in:
parent
738feb9acf
commit
1485c86dd7
@ -98,7 +98,7 @@ public:
|
||||
bool isNonNegative() const { return Zero.isSignBitSet(); }
|
||||
|
||||
/// Returns true if this value is known to be non-zero.
|
||||
bool isNonZero() const { return One.countPopulation() != 0; }
|
||||
bool isNonZero() const { return !One.isNullValue(); }
|
||||
|
||||
/// Returns true if this value is known to be positive.
|
||||
bool isStrictlyPositive() const { return Zero.isSignBitSet() && !One.isNullValue(); }
|
||||
|
Loading…
Reference in New Issue
Block a user