diff options
author | Kazu Hirata <kazu@google.com> | 2023-02-19 23:06:36 -0800 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2023-02-19 23:06:36 -0800 |
commit | 9e5d2495acbcc20efa22759c4b7b4a2da8079eef (patch) | |
tree | 381332883a0fbb93321177739a1d8a120d187c81 | |
parent | b7ffd9686ddf6bc4d8006f76acd55ac0a43a8ec7 (diff) | |
download | llvm-9e5d2495acbcc20efa22759c4b7b4a2da8079eef.zip llvm-9e5d2495acbcc20efa22759c4b7b4a2da8079eef.tar.gz llvm-9e5d2495acbcc20efa22759c4b7b4a2da8079eef.tar.bz2 |
Use APInt::isOne instead of APInt::isOneValue (NFC)
Note that isOneValue has been soft-deprecated in favor of isOne.
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 | ||||
-rw-r--r-- | mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp | 2 | ||||
-rw-r--r-- | mlir/lib/Dialect/SCF/IR/SCF.cpp | 2 | ||||
-rw-r--r-- | mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | 4 | ||||
-rw-r--r-- | mlir/lib/IR/BuiltinAttributes.cpp | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index 5b7b561..65d923ae 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -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); diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 80b9774..c3a4699 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -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), diff --git a/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp b/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp index 659d1c8..eaf69f7 100644 --- a/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp +++ b/mlir/lib/Dialect/ControlFlow/IR/ControlFlowOps.cpp @@ -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; } diff --git a/mlir/lib/Dialect/SCF/IR/SCF.cpp b/mlir/lib/Dialect/SCF/IR/SCF.cpp index 4415136..80038b9 100644 --- a/mlir/lib/Dialect/SCF/IR/SCF.cpp +++ b/mlir/lib/Dialect/SCF/IR/SCF.cpp @@ -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())); diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp index b510246..e7b8cd5 100644 --- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp @@ -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(); @@ -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(); diff --git a/mlir/lib/IR/BuiltinAttributes.cpp b/mlir/lib/IR/BuiltinAttributes.cpp index b99ec22..536328d 100644 --- a/mlir/lib/IR/BuiltinAttributes.cpp +++ b/mlir/lib/IR/BuiltinAttributes.cpp @@ -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"); |