Note that isOneValue has been soft-deprecated in favor of isOne.
// Magic algorithm doesn't work for division by 1. We need to emit a select
// at the end.
// TODO: Use undef values for divisor of 1.
- if (!Divisor.isOneValue()) {
+ if (!Divisor.isOne()) {
UnsignedDivisionByConstantInfo magics =
UnsignedDivisionByConstantInfo::get(Divisor);
// then add in the carry.
// TODO: If we can't split it in half, we might be able to split into 3 or
// more pieces using a smaller bit width.
- if (HalfMaxPlus1.urem(Divisor).isOneValue()) {
+ if (HalfMaxPlus1.urem(Divisor).isOne()) {
assert(!LL == !LH && "Expected both input halves or no input halves!");
if (!LL) {
LL = DAG.getNode(ISD::EXTRACT_ELEMENT, dl, HiLoVT, N->getOperand(0),
Block *CondBranchOp::getSuccessorForOperands(ArrayRef<Attribute> operands) {
if (IntegerAttr condAttr = operands.front().dyn_cast_or_null<IntegerAttr>())
- return condAttr.getValue().isOneValue() ? getTrueDest() : getFalseDest();
+ return condAttr.getValue().isOne() ? getTrueDest() : getFalseDest();
return nullptr;
}
// Otherwise, the successor is dependent on the condition.
bool condition;
if (auto condAttr = operands.front().dyn_cast_or_null<IntegerAttr>()) {
- condition = condAttr.getValue().isOneValue();
+ condition = condAttr.getValue().isOne();
} else {
// If the condition isn't constant, both regions may be executed.
regions.push_back(RegionSuccessor(&getThenRegion()));
// Only accept all one strides for now.
if (llvm::any_of(extractOp.getStrides().getAsValueRange<IntegerAttr>(),
- [](const APInt &val) { return !val.isOneValue(); }))
+ [](const APInt &val) { return !val.isOne(); }))
return failure();
unsigned rank = extractOp.getSourceVectorType().getRank();
// Only accept all one strides for now.
if (llvm::any_of(insertOp.getStrides().getAsValueRange<IntegerAttr>(),
- [](const APInt &val) { return !val.isOneValue(); }))
+ [](const APInt &val) { return !val.isOne(); }))
return failure();
unsigned rank = insertOp.getSourceVectorType().getRank();
// If the bitwidth is 1 we just toggle the specific bit.
if (bitWidth == 1)
- return setBit(rawData, bitPos, value.isOneValue());
+ return setBit(rawData, bitPos, value.isOne());
// Otherwise, the bit position is guaranteed to be byte aligned.
assert((bitPos % CHAR_BIT) == 0 && "expected bitPos to be 8-bit aligned");