mirror of https://github.com/llvm/torch-mlir
Fix deprecation warnings for `isOneValue` and `getAllOnesValue` (#1928)
The functions `isOneValue` and `getAllOnesValues` are deprecated. `isOne` and `getAllOnes` should be used instead.pull/1931/head
parent
327deb90cd
commit
2be48c3a67
|
@ -1065,7 +1065,7 @@ static Value createLinalgPayloadCalculationForElementwiseOp(
|
||||||
Value allOnesVal = b.create<arith::ConstantOp>(
|
Value allOnesVal = b.create<arith::ConstantOp>(
|
||||||
loc, b.getIntegerAttr(
|
loc, b.getIntegerAttr(
|
||||||
elementType,
|
elementType,
|
||||||
APSInt::getAllOnesValue(elementType.getIntOrFloatBitWidth())));
|
APSInt::getAllOnes(elementType.getIntOrFloatBitWidth())));
|
||||||
return b.create<arith::XOrIOp>(loc, payloadArgs[0], allOnesVal);
|
return b.create<arith::XOrIOp>(loc, payloadArgs[0], allOnesVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -390,7 +390,7 @@ void PrimIfOp::getSuccessorRegions(std::optional<unsigned> index,
|
||||||
// If the condition is constant, we can give a more precise answer.
|
// If the condition is constant, we can give a more precise answer.
|
||||||
if (auto condAttr = operands.front().dyn_cast_or_null<IntegerAttr>()) {
|
if (auto condAttr = operands.front().dyn_cast_or_null<IntegerAttr>()) {
|
||||||
Region *executedRegion =
|
Region *executedRegion =
|
||||||
condAttr.getValue().isOneValue() ? &getThenRegion() : &getElseRegion();
|
condAttr.getValue().isOne() ? &getThenRegion() : &getElseRegion();
|
||||||
regions.push_back(RegionSuccessor(executedRegion));
|
regions.push_back(RegionSuccessor(executedRegion));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue