From: Kazu Hirata Date: Mon, 20 Feb 2023 07:06:36 +0000 (-0800) Subject: Use APInt::isOne instead of APInt::isOneValue (NFC) X-Git-Tag: upstream/17.0.6~17001 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e5d2495acbcc20efa22759c4b7b4a2da8079eef;p=platform%2Fupstream%2Fllvm.git Use APInt::isOne instead of APInt::isOneValue (NFC) Note that isOneValue has been soft-deprecated in favor of isOne. --- 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 operands) { if (IntegerAttr condAttr = operands.front().dyn_cast_or_null()) - 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 index, // Otherwise, the successor is dependent on the condition. bool condition; if (auto condAttr = operands.front().dyn_cast_or_null()) { - 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(), - [](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(), - [](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");