[Mlir-commits] [mlir] [mlir][arith] Add ValueBoundsOpInterface external models for the arith integer CielDiv, RemSI, RemUI, MaxUI, MinUI. (PR #204966)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Jun 21 01:27:58 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- mlir/lib/Dialect/Arith/IR/ArithDialect.cpp mlir/lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/Arith/IR/ArithDialect.cpp b/mlir/lib/Dialect/Arith/IR/ArithDialect.cpp
index 3799db1cb..5f645af27 100644
--- a/mlir/lib/Dialect/Arith/IR/ArithDialect.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ArithDialect.cpp
@@ -56,8 +56,9 @@ void arith::ArithDialect::initialize() {
declarePromisedInterfaces<bufferization::BufferizableOpInterface, ConstantOp,
IndexCastOp, SelectOp>();
declarePromisedInterfaces<ValueBoundsOpInterface, AddIOp, ConstantOp, SubIOp,
- MulIOp, SelectOp, FloorDivSIOp, CeilDivSIOp, MinSIOp,
- MaxSIOp, MinUIOp, MaxUIOp, RemSIOp, RemUIOp>();
+ MulIOp, SelectOp, FloorDivSIOp, CeilDivSIOp,
+ MinSIOp, MaxSIOp, MinUIOp, MaxUIOp, RemSIOp,
+ RemUIOp>();
}
/// Materialize an integer or floating point constant.
diff --git a/mlir/lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp b/mlir/lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp
index 7c53451f3..725d5a60e 100644
--- a/mlir/lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp
@@ -17,16 +17,14 @@ namespace mlir {
namespace arith {
namespace {
-static bool isProvablyNonNegative(Value value,
- ValueBoundsConstraintSet &cstr) {
+static bool isProvablyNonNegative(Value value, ValueBoundsConstraintSet &cstr) {
return cstr.populateAndCompare(
/*lhs=*/{value}, ValueBoundsConstraintSet::ComparisonOperator::GE,
/*rhs=*/{OpFoldResult(Builder(value.getContext()).getIndexAttr(0))});
}
-static bool isProvablyNonPositive(Value value,
- ValueBoundsConstraintSet &cstr) {
- return cstr.populateAndCompare(
+static bool isProvablyNonPositive(Value value, ValueBoundsConstraintSet &cstr) {
+ return cstr.populateAndCompare(
/*lhs=*/{value}, ValueBoundsConstraintSet::ComparisonOperator::LE,
/*rhs=*/{OpFoldResult(Builder(value.getContext()).getIndexAttr(0))});
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/204966
More information about the Mlir-commits
mailing list