From 2be48c3a67d9d8f4af03de37a1ad1eca8081b8f4 Mon Sep 17 00:00:00 2001 From: Ramiro Leal-Cavazos Date: Fri, 10 Mar 2023 09:50:56 -0800 Subject: [PATCH] Fix deprecation warnings for `isOneValue` and `getAllOnesValue` (#1928) The functions `isOneValue` and `getAllOnesValues` are deprecated. `isOne` and `getAllOnes` should be used instead. --- lib/Conversion/TorchToLinalg/Uncategorized.cpp | 2 +- lib/Dialect/Torch/IR/TorchOps.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Conversion/TorchToLinalg/Uncategorized.cpp b/lib/Conversion/TorchToLinalg/Uncategorized.cpp index 69fe4eff3..49730d5bf 100644 --- a/lib/Conversion/TorchToLinalg/Uncategorized.cpp +++ b/lib/Conversion/TorchToLinalg/Uncategorized.cpp @@ -1065,7 +1065,7 @@ static Value createLinalgPayloadCalculationForElementwiseOp( Value allOnesVal = b.create( loc, b.getIntegerAttr( elementType, - APSInt::getAllOnesValue(elementType.getIntOrFloatBitWidth()))); + APSInt::getAllOnes(elementType.getIntOrFloatBitWidth()))); return b.create(loc, payloadArgs[0], allOnesVal); } diff --git a/lib/Dialect/Torch/IR/TorchOps.cpp b/lib/Dialect/Torch/IR/TorchOps.cpp index f688e6720..7c5096e22 100644 --- a/lib/Dialect/Torch/IR/TorchOps.cpp +++ b/lib/Dialect/Torch/IR/TorchOps.cpp @@ -390,7 +390,7 @@ void PrimIfOp::getSuccessorRegions(std::optional index, // If the condition is constant, we can give a more precise answer. if (auto condAttr = operands.front().dyn_cast_or_null()) { Region *executedRegion = - condAttr.getValue().isOneValue() ? &getThenRegion() : &getElseRegion(); + condAttr.getValue().isOne() ? &getThenRegion() : &getElseRegion(); regions.push_back(RegionSuccessor(executedRegion)); return; }