[PATCH] D80267: [mlir][Linalg] Refactor linalg tiling

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 20:21:44 PDT 2020


nicolasvasilache created this revision.
nicolasvasilache added a reviewer: ftynse.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini, arphaman.
Herald added a project: LLVM.
nicolasvasilache added a reviewer: mravishankar.
nicolasvasilache added a reviewer: antiagainst.
nicolasvasilache added reviewers: pifon2a, herhut.

This revision refactors the Linalg tiling pass to be written as pattern applications and retires the use of the folder in Linalg tiling.
In the early days, tiling was written as a pass that would create (partially) folded and canonicalized operations on the fly for better composability.
As this evolves towards composition of patterns, the pass-specific folder is counter-productive and is retired.
The tiling options struct evolves to take a tile size creation function which allows materializing tile sizes on the fly (in particular constant tile sizes). This plays better with folding and DCE.

With the folder going away in Tiling, the check on whether subviews are the same in linalg fusion needs to be more robust. This revision also implements such a check.

In the current form, there are still some canonicalizations missing due to  AffineMin/Max ops fed by scf::ForOp. These will be improved at a later time.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80267

Files:
  mlir/include/mlir/Dialect/Linalg/EDSC/Builders.h
  mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
  mlir/lib/Dialect/Linalg/EDSC/Builders.cpp
  mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
  mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
  mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
  mlir/test/Dialect/Linalg/tile.mlir
  mlir/test/Dialect/Linalg/tile_conv.mlir
  mlir/test/Dialect/Linalg/tile_conv_padding.mlir
  mlir/test/Dialect/Linalg/tile_indexed_generic.mlir
  mlir/test/Dialect/Linalg/tile_parallel.mlir
  mlir/test/lib/Transforms/TestLinalgTransforms.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80267.265119.patch
Type: text/x-patch
Size: 79363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200520/c00625f8/attachment.bin>


More information about the llvm-commits mailing list