Skip to content

Commit

Permalink
Use APInt::isOne instead of APInt::isOneValue (NFC)
Browse files Browse the repository at this point in the history
Note that isOneValue has been soft-deprecated in favor of isOne.
  • Loading branch information
kazutakahirata committed Feb 20, 2023
1 parent b7ffd96 commit 9e5d249
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
Expand Up @@ -4968,7 +4968,7 @@ MachineInstr *CombinerHelper::buildUDivUsingMul(MachineInstr &MI) {
// 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);

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Expand Up @@ -7338,7 +7338,7 @@ bool TargetLowering::expandDIVREMByConstant(SDNode *N,
// 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),
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp
Expand Up @@ -442,7 +442,7 @@ SuccessorOperands CondBranchOp::getSuccessorOperands(unsigned index) {

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;
}

Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/SCF/IR/SCF.cpp
Expand Up @@ -1746,7 +1746,7 @@ void IfOp::getSuccessorRegions(std::optional<unsigned> index,
// 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()));
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
Expand Up @@ -2466,7 +2466,7 @@ struct BubbleDownBitCastForStridedSliceExtract

// 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();
Expand Down Expand Up @@ -2553,7 +2553,7 @@ struct BubbleUpBitCastForStridedSliceInsert

// 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();
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/IR/BuiltinAttributes.cpp
Expand Up @@ -530,7 +530,7 @@ static void writeBits(char *rawData, size_t bitPos, APInt value) {

// 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");
Expand Down

0 comments on commit 9e5d249

Please sign in to comment.