llvm-project/mlir/lib/Transforms
Diego Caballero c8fc5c0385 [mlir][Affine] Add support for multi-store producer fusion
This patch adds support for producer-consumer fusion scenarios with
multiple producer stores to the AffineLoopFusion pass. The patch
introduces some changes to the producer-consumer algorithm, including:

* For a given consumer loop, producer-consumer fusion iterates over its
producer candidates until a fixed point is reached.

* Producer candidates are gathered beforehand for each iteration of the
consumer loop and visited in reverse program order (not strictly guaranteed)
to maximize the number of loops fused per iteration.

In general, these changes were needed to simplify the multi-store producer
support and remove some of the workarounds that were introduced in the past
to support more fusion cases under the single-store producer limitation.

This patch also preserves the existing functionality of AffineLoopFusion with
one minor change in behavior. Producer-consumer fusion didn't fuse scenarios
with escaping memrefs and multiple outgoing edges (from a single store).
Multi-store producer scenarios will usually (always?) have multiple outgoing
edges so we couldn't fuse any with escaping memrefs, which would greatly limit
the applicability of this new feature. Therefore, the patch enables fusion for
these scenarios. Please, see modified tests for specific details.

Reviewed By: andydavis1, bondhugula

Differential Revision: https://reviews.llvm.org/D92876
2021-01-25 20:31:17 +02:00
..
Utils [mlir][Affine] Add support for multi-store producer fusion 2021-01-25 20:31:17 +02:00
BufferDeallocation.cpp Added check if there are regions that do not implement the RegionBranchOpInterface. 2021-01-20 12:15:28 +01:00
BufferOptimizations.cpp [MLIR] Added support for dynamic shaped allocas to promote-buffers-to-stack pass. 2020-12-03 11:47:49 +01:00
BufferResultsToOutParams.cpp [mlir][IR][NFC] Move context/location parameters of builtin Type::get methods to the start of the parameter list 2020-12-17 13:01:36 -08:00
BufferUtils.cpp [mlir] NFC: fix trivial typos 2021-01-08 02:10:12 +09:00
Bufferize.cpp [mlir] Small cleanups to func-bufferize/finalizing-bufferize 2020-11-30 17:04:14 -08:00
CMakeLists.txt [mlir] Split BufferUtils.h out of Bufferize.h 2020-11-19 12:56:36 -08:00
CSE.cpp [MLIR] Add RegionKindInterface 2020-07-15 14:27:05 -07:00
Canonicalizer.cpp [mlir] Add a hook for initializing passes before execution and use it in the Canonicalizer 2021-01-08 13:36:12 -08:00
CopyRemoval.cpp [mlir] Fix bug in copy removal 2020-09-08 14:17:13 +02:00
Inliner.cpp [mlir] Skip empty op-pipelines in inliner textual opt parsing 2020-12-29 13:59:53 -08:00
LocationSnapshot.cpp [mlir][Pass] Update the PassGen to generate base classes instead of utilities 2020-04-07 14:08:52 -07:00
LoopCoalescing.cpp [mlir] Use mlir::OpState::operator->() to get to methods of mlir::Operation. This is a preparation step to remove the corresponding methods from OpState. 2020-12-09 12:11:32 +01:00
LoopFusion.cpp [mlir][Affine] Add support for multi-store producer fusion 2021-01-25 20:31:17 +02:00
LoopInvariantCodeMotion.cpp [mlir][BuiltinDialect] Resolve comments from D91571 2020-11-19 11:12:49 -08:00
MemRefDataFlowOpt.cpp [MLIR] Vector store to load forwarding 2020-07-28 11:30:54 -07:00
NormalizeMemRefs.cpp [mlir][IR][NFC] Move context/location parameters of builtin Type::get methods to the start of the parameter list 2020-12-17 13:01:36 -08:00
OpStats.cpp [mlir][BuiltinDialect] Resolve comments from D91571 2020-11-19 11:12:49 -08:00
ParallelLoopCollapsing.cpp [mlir] NFC: Rename LoopOps dialect to SCF (Structured Control Flow) 2020-05-11 15:04:27 +02:00
PassDetail.h Separate the Registration from Loading dialects in the Context 2020-08-19 01:19:03 +00:00
PipelineDataTransfer.cpp [MLIR][Linalg] Refactor transforms to use linalg::getDynOperands helper 2021-01-11 16:24:59 -08:00
SCCP.cpp [mlir] Remove the MutableDictionaryAttr class 2020-12-17 17:18:42 -08:00
StripDebugInfo.cpp [mlir][BuiltinDialect] Resolve comments from D91571 2020-11-19 11:12:49 -08:00
SymbolDCE.cpp [mlir] Optimize symbol related checks in SymbolDCE 2020-10-16 12:08:48 -07:00
ViewOpGraph.cpp [mlir][Types][NFC] Move all of the builtin Type classes to BuiltinTypes.h 2020-12-03 18:02:10 -08:00
ViewRegionGraph.cpp [mlir][Pass] Update the PassGen to generate base classes instead of utilities 2020-04-07 14:08:52 -07:00