summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Analysis/LoopAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Analysis/LoopAnalysis.cpp')
-rw-r--r--mlir/lib/Analysis/LoopAnalysis.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/mlir/lib/Analysis/LoopAnalysis.cpp b/mlir/lib/Analysis/LoopAnalysis.cpp
index 219f356807a..07c903a6613 100644
--- a/mlir/lib/Analysis/LoopAnalysis.cpp
+++ b/mlir/lib/Analysis/LoopAnalysis.cpp
@@ -21,6 +21,7 @@
#include "mlir/Analysis/LoopAnalysis.h"
+#include "mlir/AffineOps/AffineOps.h"
#include "mlir/Analysis/AffineAnalysis.h"
#include "mlir/Analysis/AffineStructures.h"
#include "mlir/Analysis/NestedMatcher.h"
@@ -246,6 +247,16 @@ static bool isVectorizableLoopWithCond(const ForInst &loop,
return false;
}
+ // No vectorization across unknown regions.
+ auto regions = matcher::Op([](const Instruction &inst) -> bool {
+ auto &opInst = cast<OperationInst>(inst);
+ return opInst.getNumBlockLists() != 0 && !opInst.isa<AffineIfOp>();
+ });
+ auto regionsMatched = regions.match(forInst);
+ if (!regionsMatched.empty()) {
+ return false;
+ }
+
auto vectorTransfers = matcher::Op(isVectorTransferReadOrWrite);
auto vectorTransfersMatched = vectorTransfers.match(forInst);
if (!vectorTransfersMatched.empty()) {
OpenPOWER on IntegriCloud