Uniformize the API for the mlir::tile functions on AffineForOp and loop::ForOp
authorNicolas Vasilache <ntv@google.com>
Fri, 19 Jul 2019 08:52:36 +0000 (01:52 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Fri, 19 Jul 2019 18:40:25 +0000 (11:40 -0700)
commit5bc344743c25e49c74af3ea0887c7930a77e393a
tree59dfe806b1769261599dc12fb43564e54ab8b0c7
parent28057ff3daa241f79417817a9d9ee821cffc83fd
Uniformize the API for the mlir::tile functions on AffineForOp and loop::ForOp

This CL adapts the recently introduced parametric tiling to have an API matching the tiling
of AffineForOp. The transformation using stripmineSink is more general and produces  imperfectly nested loops.

Perfect nesting invariants of the tiled version are obtained by selectively applying hoisting of ops to isolate perfectly nested bands. Such hoisting may fail to produce a perfect loop nest in cases where ForOp transitively depend on enclosing induction variables. In such cases, the API provides a LogicalResult return but the SimpleParametricLoopTilingPass does not currently use this result.

A new unit test is added with a triangular loop for which the perfect nesting property does not hold. For this example, the old behavior was to produce IR that did not verify (some use was not dominated by its def).

PiperOrigin-RevId: 258928309
mlir/include/mlir/Transforms/LoopUtils.h
mlir/lib/Analysis/CMakeLists.txt
mlir/lib/Analysis/SliceAnalysis.cpp
mlir/lib/Transforms/LoopParametricTiling.cpp
mlir/lib/Transforms/Utils/LoopUtils.cpp
mlir/test/Transforms/parametric_tiling.mlir