/// common code. It also correctly performs the comparison without the
/// potential for an assertion from getZExtValue().
bool isZero() const {
- return Val == 0;
+ return Val.isNullValue();
}
/// This is just a convenience method to make client code smaller for a
/// potential for an assertion from getZExtValue().
/// @brief Determine if the value is one.
bool isOne() const {
- return Val == 1;
+ return Val.isOneValue();
}
/// This function will return true iff every bit in this constant is set
/// @returns true iff this constant is greater or equal to the given number.
/// @brief Determine if the value is greater or equal to the given number.
bool uge(uint64_t Num) const {
- return Val.getActiveBits() > 64 || Val.getZExtValue() >= Num;
+ return Val.uge(Num);
}
/// getLimitedValue - If the value is smaller than the specified limit,
// Check for FP which are bitcasted from 1 integers
if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
- return CFP->getValueAPF().bitcastToAPInt() == 1;
+ return CFP->getValueAPF().bitcastToAPInt().isOneValue();
// Check for constant vectors which are splats of 1 values.
if (const ConstantVector *CV = dyn_cast<ConstantVector>(this))