[Mlir-commits] [mlir] [MLIR] Fix typo bug in AffineExprVisitor for WalkResult return case (PR #86138)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Mar 21 08:41:26 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-core

Author: Uday Bondhugula (bondhugula)

<details>
<summary>Changes</summary>

Fix typo bug in AffineExprVisitor for the WalkResult return case. This
didn't show up immmediately because most walks in the tree didn't
use walk result.


---
Full diff: https://github.com/llvm/llvm-project/pull/86138.diff


2 Files Affected:

- (modified) mlir/include/mlir/IR/AffineExprVisitor.h (+1-1) 
- (modified) mlir/test/IR/affine-walk.mlir (+5) 


``````````diff
diff --git a/mlir/include/mlir/IR/AffineExprVisitor.h b/mlir/include/mlir/IR/AffineExprVisitor.h
index 3e1bbb4b3fa0ea..27c49cd80018e9 100644
--- a/mlir/include/mlir/IR/AffineExprVisitor.h
+++ b/mlir/include/mlir/IR/AffineExprVisitor.h
@@ -222,7 +222,7 @@ class AffineExprVisitor : public AffineExprVisitorBase<SubClass, RetTy> {
       walkPostOrder(expr.getLHS());
     }
     if constexpr (std::is_same<RetTy, WalkResult>::value) {
-      if (walkPostOrder(expr.getLHS()).wasInterrupted())
+      if (walkPostOrder(expr.getRHS()).wasInterrupted())
         return WalkResult::interrupt();
       return WalkResult::advance();
     } else {
diff --git a/mlir/test/IR/affine-walk.mlir b/mlir/test/IR/affine-walk.mlir
index 1de675ac70be2d..0ee7abf9415cf3 100644
--- a/mlir/test/IR/affine-walk.mlir
+++ b/mlir/test/IR/affine-walk.mlir
@@ -7,3 +7,8 @@
 
 "test.check_first_mod"() {"map" = #map} : () -> ()
 // expected-remark at -1 {{mod expression}}
+
+#map_rhs_mod = affine_map<(i, j) -> (i + i mod 2, j)>
+
+"test.check_first_mod"() {"map" = #map_rhs_mod} : () -> ()
+// expected-remark at -1 {{mod expression}}

``````````

</details>


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


More information about the Mlir-commits mailing list