[Mlir-commits] [mlir] [mlir] Remove redundant check in LoopAnalysis (PR #75950)

Hsiangkai Wang llvmlistbot at llvm.org
Tue Dec 19 09:07:18 PST 2023


https://github.com/Hsiangkai updated https://github.com/llvm/llvm-project/pull/75950

>From 517d00ae2e1796a76ea3bafe12f963a015c0084f Mon Sep 17 00:00:00 2001
From: Hsiangkai Wang <hsiangkai.wang at arm.com>
Date: Tue, 19 Dec 2023 15:56:47 +0000
Subject: [PATCH] [mlir][affine] Remove redundant check in LoopAnalysis

We do not support vectorization across conditionals. We already check it
in the beginning of isVectorizableLoopBodyWithOpCond(). There should be no
need to check AffineIfOp when checking regions in a loop.
---
 mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
index e645afe7cd3e8f..7a95bf5d4cb52d 100644
--- a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
@@ -302,7 +302,7 @@ isVectorizableLoopBodyWithOpCond(AffineForOp loop,
 
   // No vectorization across unknown regions.
   auto regions = matcher::Op([](Operation &op) -> bool {
-    return op.getNumRegions() != 0 && !isa<AffineIfOp, AffineForOp>(op);
+    return op.getNumRegions() != 0 && !isa<AffineForOp>(op);
   });
   SmallVector<NestedMatch, 8> regionsMatched;
   regions.match(forOp, &regionsMatched);



More information about the Mlir-commits mailing list