[PATCH] D75722: [mlir][Linalg] Implement padding for lowering linalg to loops.

Han-Chung Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 20:11:24 PST 2020


hanchung created this revision.
hanchung added reviewers: asaadaldien, nicolasvasilache, herhut, pifon2a, mravishankar.
Herald added subscribers: llvm-commits, Joonsoo, liufengdb, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, burmako, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.

To enable this, two changes are needed:

1. Add an optional attribute `padding` to linalg.conv.
2. Compute if the indices accessing is out of bound in the loops. If so, use the

padding value `0`. Otherwise, use the value derived from load.

In the patch, the padding only works for lowering without other transformations,
e.g., tiling, fusion, etc.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75722

Files:
  mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
  mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
  mlir/lib/Dialect/Linalg/Transforms/LinalgToLoops.cpp
  mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
  mlir/test/Dialect/Linalg/loops.mlir
  mlir/test/Dialect/Linalg/roundtrip.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75722.248647.patch
Type: text/x-patch
Size: 9130 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200306/aeb27772/attachment.bin>


More information about the llvm-commits mailing list