[PATCH] D79502: [mlir] Support partial folding of affine.min/max

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 10:13:38 PDT 2020


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

Originally, these operations were folded only if all expressions in their
affine maps could be folded to a constant expression that can be then subject
to numeric min/max computation. This introduces a more advanced version that
partially folds the affine map by lifting individual constant expression in it
even if some of the expressions remain variable. The folding can update the
operation in place to use a simpler map. Note that this is not as powerful as
canonicalization, in particular this does not remove dimensions or symbols that
became useless. This allows for better composition of Linalg tiling and
promotion transformation, where the latter can handle some canonical forms of
affine.min that the folding can now produce.

Depends On D79497 <https://reviews.llvm.org/D79497>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79502

Files:
  mlir/include/mlir/IR/AffineMap.h
  mlir/lib/Dialect/Affine/IR/AffineOps.cpp
  mlir/lib/IR/AffineMap.cpp
  mlir/test/Dialect/Linalg/tile.mlir
  mlir/test/Dialect/Linalg/tile_conv.mlir
  mlir/test/Dialect/Linalg/tile_conv_padding.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D79502.262407.patch
Type: text/x-patch
Size: 17429 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200506/ca0ec01a/attachment-0001.bin>


More information about the llvm-commits mailing list