[Mlir-commits] [mlir] [MLIR] Fix typo bug in AffineExprVisitor for WalkResult return case (PR #86138)
Uday Bondhugula
llvmlistbot at llvm.org
Thu Mar 21 08:40:50 PDT 2024
https://github.com/bondhugula created https://github.com/llvm/llvm-project/pull/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.
>From d6781c0ec2427d1118aa08022f153a336af44a75 Mon Sep 17 00:00:00 2001
From: Uday Bondhugula <uday at polymagelabs.com>
Date: Thu, 21 Mar 2024 17:51:58 +0530
Subject: [PATCH] [MLIR] Fix typo bug in AffineExprVisitor for WalkResult
return case
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.
---
mlir/include/mlir/IR/AffineExprVisitor.h | 2 +-
mlir/test/IR/affine-walk.mlir | 5 +++++
2 files changed, 6 insertions(+), 1 deletion(-)
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}}
More information about the Mlir-commits
mailing list