From 15332982c3d8d1c9e8bd7ae9f76f22f77adb51ee Mon Sep 17 00:00:00 2001 From: Vinayaka Bandishti Date: Mon, 22 Feb 2021 21:31:48 +0530 Subject: [MLIR][affine] Prevent fusion when ops with memory effect free are present between producer and consumer This commit fixes a bug in affine fusion pipeline where an incorrect fusion is performed despite a dealloc op is present between a producer and a consumer. This is done by creating a node for dealloc op in the MDG. Reviewed By: bondhugula, dcaballe Differential Revision: https://reviews.llvm.org/D97032 --- mlir/lib/Transforms/LoopFusion.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mlir/lib/Transforms/LoopFusion.cpp') diff --git a/mlir/lib/Transforms/LoopFusion.cpp b/mlir/lib/Transforms/LoopFusion.cpp index e13616e..d6d26a8 100644 --- a/mlir/lib/Transforms/LoopFusion.cpp +++ b/mlir/lib/Transforms/LoopFusion.cpp @@ -768,7 +768,8 @@ bool MemRefDependenceGraph::init(FuncOp f) { SmallVector effects; effectInterface.getEffects(effects); if (llvm::any_of(effects, [](const MemoryEffects::EffectInstance &it) { - return isa(it.getEffect()); + return isa( + it.getEffect()); })) { Node node(nextNodeId++, &op); nodes.insert({node.id, node}); -- cgit v1.1