From 7ea94922fa0d8ac6b041c0dc4cd9f8135f0e60bb Mon Sep 17 00:00:00 2001 From: Tres Popp Date: Wed, 9 Dec 2020 21:54:58 +0100 Subject: [PATCH] [mlir] Allow RegionBranchOps in dependence analysis This is to prevent assertion failures on scf.if and shape.assuming operations where this is not enough information currently to handle any aliasing information. Differential Revision: https://reviews.llvm.org/D92963 --- mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp index 99e2e6ab07f..ca2d16e8de8 100644 --- a/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp +++ b/mlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp @@ -43,6 +43,10 @@ Value Aliases::find(Value v) { if (!defOp) return v; + // Treat RegionBranchOpInterfaces like an allocate and don't try to follow + // the aliasing further. + if (isa(defOp)) + return v; if (isa(defOp)) return v; -- 2.11.0