[PATCH] D80728: [mlir][Linalg][Vector] Add forwarding patterns between linalg.copy and vector.transfer
Nicolas Vasilache via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 28 08:42:42 PDT 2020
nicolasvasilache created this revision.
nicolasvasilache added reviewers: ftynse, aartbik.
Herald added subscribers: llvm-commits, jurahul, Kayjukh, frgossen, grosul1, Joonsoo, stephenneuendorffer, liufengdb, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini.
Herald added a project: LLVM.
This revision adds custom rewrites for patterns that arise during linalg structured
ops vectorization. These patterns allow the composition of linalg promotion,
vectorization and removal of redundant copies.
The patterns are voluntarily limited and restrictive atm.
More robust behavior will be implemented once more powerful side effect modeling and
analyses are available on view/subview.
On the transfer_read side, the following pattern is rewritten:
%alloc = ...
[optional] %view = std.view %alloc ...
%subView = subview %A ...
[optional] linalg.fill(%allocOrView, %cst) ...
linalg.copy(%in, %subView) ...
vector.transfer_read %allocOrView[...], %cst ...
On the transfer_write side, the following pattern is rewriten:
%alloc = ...
[optional] %view = std.view %alloc ...
%subView = subview %allocOrView...
...
vector.transfer_write %..., %allocOrView[...]
linalg.copy(%subView, %out)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80728
Files:
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/test/Dialect/Linalg/forward-vector-transfers.mlir
mlir/test/lib/Transforms/TestLinalgTransforms.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80728.266889.patch
Type: text/x-patch
Size: 21811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200528/5afd2924/attachment.bin>
More information about the llvm-commits
mailing list