[PATCH] D74954: Add a basic tiling pass for parallel loops

Stephan Herhut via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 01:28:05 PST 2020


herhut added a comment.

In D74954#1887027 <https://reviews.llvm.org/D74954#1887027>, @dcaballe wrote:

> Just adding some minor nit comments!
>
> >> We already several implementations of loop tiling (lib/Transforms/LoopTiling.cpp, lib/Dialect/Linalg/Transforms/Tiling.cpp, lib/Transforms/Utils/LoopUtils.cpp). Have you considered generalizing them instead of introducing yet another one? I suppose parallel loop nest as an operation removes the need for any supplementary preconditions, but the mechanics of the transformation should be very similar between parallel and sequential loops.
>
>
>
> > The complexity of the tiling passes is in the dependency analysis and not the rewriting itself. This one is purely structural. We would need to split the actual tiling rewrite form the analysis with interfaces for generating the tiled operation. I am not sure that is worth the code we would actually get to reuse.
>
> I think it might be worth it since affine parallel for would be another candidate for tiling.


I guess we would need to compute the new step sizes as affine expressions, as well, in such case. My point was how much code reuse we would get.



================
Comment at: mlir/lib/Dialect/LoopOps/Transforms/ParallelLoopTiling.cpp:33
+///     loop.parallel (%i0, %i1) = (0, 0) to (min(%arg2, %arg0),
+///                                           min(%arg3, %arg1))
+///                                        step (%arg4, %arg5)
----------------
This comment does not state the actual rewriting, does it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74954/new/

https://reviews.llvm.org/D74954





More information about the llvm-commits mailing list