[llvm-branch-commits] [mlir] [mlir][Interfaces][NFC] `ValueBoundsConstraintSet`: Pass stop condition in the constructor (PR #86099)

Jakub Kuderski via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Mar 21 19:52:06 PDT 2024


================
@@ -113,8 +113,9 @@ class ValueBoundsConstraintSet {
   ///
   /// The first parameter of the function is the shaped value/index-typed
   /// value. The second parameter is the dimension in case of a shaped value.
-  using StopConditionFn =
-      function_ref<bool(Value, std::optional<int64_t> /*dim*/)>;
+  /// The third parameter is this constraint set.
+  using StopConditionFn = std::function<bool(
+      Value, std::optional<int64_t> /*dim*/, ValueBoundsConstraintSet &cstr)>;
----------------
kuhar wrote:

This comment is not directly related to the changes in this PR, but It's not immediately clear to me if which value indicates stop/continuation. I like the `walk` function much more which exposes `WalkResult::interrup()` and `WalkRedult::advance()`, but I think that changing to `LogicalResult` and renaming this could also help.
Would be cool if we could revisit this separately.

https://github.com/llvm/llvm-project/pull/86099


More information about the llvm-branch-commits mailing list