Skip to content

Commit 0e5a53c

Browse files
authored
[MLIR] Fix typo bug in AffineExprVisitor for WalkResult return case (#86138)
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.
1 parent 71eda17 commit 0e5a53c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

mlir/include/mlir/IR/AffineExprVisitor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ class AffineExprVisitor : public AffineExprVisitorBase<SubClass, RetTy> {
222222
walkPostOrder(expr.getLHS());
223223
}
224224
if constexpr (std::is_same<RetTy, WalkResult>::value) {
225-
if (walkPostOrder(expr.getLHS()).wasInterrupted())
225+
if (walkPostOrder(expr.getRHS()).wasInterrupted())
226226
return WalkResult::interrupt();
227227
return WalkResult::advance();
228228
} else {

mlir/test/IR/affine-walk.mlir

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77

88
"test.check_first_mod"() {"map" = #map} : () -> ()
99
// expected-remark@-1 {{mod expression}}
10+
11+
#map_rhs_mod = affine_map<(i, j) -> (i + i mod 2, j)>
12+
13+
"test.check_first_mod"() {"map" = #map_rhs_mod} : () -> ()
14+
// expected-remark@-1 {{mod expression}}

0 commit comments

Comments
 (0)