[mlir][Linalg] Add a hoistPaddingOnTensors transformation
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 25 Jan 2021 11:48:39 +0000 (11:48 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 25 Jan 2021 12:41:18 +0000 (12:41 +0000)
commitdbf9bedf40792cf8c5492a27b61809737793b9c7
tree10c9f029506e425a6466d288e9374078aa673546
parent1c8f199f449916d30ec12ecc5bb0f157ab1d01a0
[mlir][Linalg] Add a hoistPaddingOnTensors transformation

This transformation anchors on a padding op whose result is only used as an input
to a Linalg op and pulls it out of a given number of loops.
The result is a packing of padded tailes of ops that is amortized just before
the outermost loop from which the pad operation is hoisted.

Differential revision: https://reviews.llvm.org/D95243
mlir/include/mlir/Dialect/Linalg/Transforms/Hoisting.h
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/Dialect/Linalg/hoist-padding.mlir [new file with mode: 0644]
mlir/test/lib/Transforms/TestLinalgTransforms.cpp