[all-commits] [llvm/llvm-project] c8fc5c: [mlir][Affine] Add support for multi-store produce...

Diego Caballero via All-commits all-commits at lists.llvm.org
Mon Jan 25 10:32:17 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8fc5c0385dbb47623c1cca5efa0b96d5e5f8151
      https://github.com/llvm/llvm-project/commit/c8fc5c0385dbb47623c1cca5efa0b96d5e5f8151
  Author: Diego Caballero <diego.caballero at intel.com>
  Date:   2021-01-25 (Mon, 25 Jan 2021)

  Changed paths:
    M mlir/include/mlir/Analysis/AffineStructures.h
    M mlir/include/mlir/Analysis/Utils.h
    M mlir/include/mlir/Transforms/LoopFusionUtils.h
    M mlir/include/mlir/Transforms/Passes.td
    M mlir/lib/Analysis/AffineStructures.cpp
    M mlir/lib/Analysis/Utils.cpp
    M mlir/lib/Transforms/LoopFusion.cpp
    M mlir/lib/Transforms/Utils/LoopFusionUtils.cpp
    M mlir/test/Transforms/loop-fusion.mlir

  Log Message:
  -----------
  [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




More information about the All-commits mailing list