[PATCH] D79759: [mlir] Add SubViewOp::getOrCreateRanges and fix folding pattern

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 11 19:27:46 PDT 2020


nicolasvasilache created this revision.
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: aartbik.
Herald added a project: LLVM.
nicolasvasilache added reviewers: ftynse, mravishankar.
nicolasvasilache added a reviewer: poechsel.
nicolasvasilache updated this revision to Diff 263338.
nicolasvasilache added a comment.

Drop spurious methods in Ops.td.


The existing implementation of SubViewOp::getRanges relies on all
offsets/sizes/strides to be dynamic values and does not work in
combination with canonicalization. This revision adds a
`SubViewOp::getOrCreateRanges` to create the missing constants in the
canonicalized case.

This allows reactivating the fused pass with staged pattern
applications.

However another issue surfaces that the SubViewOp verifier is now too
strict to allow folding. The existing folding pattern is turned into a
canonicalization pattern which rewrites memref_cast + subview into
subview + memref_cast.

The transform-patterns-matmul-to-vector can then be reactivated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79759

Files:
  mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
  mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
  mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
  mlir/lib/Dialect/StandardOps/IR/Ops.cpp
  mlir/test/Dialect/Linalg/transform-patterns-matmul-to-vector.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79759.263338.patch
Type: text/x-patch
Size: 13579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200512/234508e2/attachment.bin>


More information about the llvm-commits mailing list