[PATCH] D79518: [mlir][Linalg] Introduce a helper function for staged pattern application

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 13:35:24 PDT 2020


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

This revision introduces a helper function to allow applying rewrite patterns, interleaved with more global transformations, in a staged fashion:

1. the first stage consists of an OwningRewritePatternList. The RewritePattern in this list are applied once and in order.
2. the second stage consists of a single OwningRewritePattern that is applied greedily until convergence.
3. the third stage consists of applying a lambda, generally used for non-local transformation effects.

This allows creating custom fused transformations where patterns can be ordered and applied at a finer granularity than a sequence of traditional compiler passes.

A test that exercises these behaviors is added.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79518

Files:
  mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
  mlir/include/mlir/IR/PatternMatch.h
  mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
  mlir/test/Dialect/Linalg/transform-patterns-matmul-to-vector.mlir
  mlir/test/lib/Transforms/TestLinalgTransforms.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79518.262464.patch
Type: text/x-patch
Size: 8952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200506/e7bc8180/attachment.bin>


More information about the llvm-commits mailing list