[mlir][linalg] Support permutation when lowering to loop nests
authorLei Zhang <antiagainst@google.com>
Mon, 11 Jan 2021 14:08:21 +0000 (09:08 -0500)
committerLei Zhang <antiagainst@google.com>
Mon, 11 Jan 2021 14:13:06 +0000 (09:13 -0500)
commit55225471d9838e452cfb31e0edae6162b7226221
treef654e47cd3576fbf45fc8516c806a339f7ab4c24
parentdf86f15f0c53c395dac5a14aba08745bc12b9b9b
[mlir][linalg] Support permutation when lowering to loop nests

Linalg ops are perfect loop nests. When materializing the concrete
loop nest, the default order specified by the Linalg op's iterators
may not be the best for further CodeGen: targets frequently need
to plan the loop order in order to gain better data access. And
different targets can have different preferences. So there should
exist a way to control the order.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D91795
mlir/include/mlir/Dialect/Linalg/Passes.td
mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
mlir/lib/Dialect/Linalg/Transforms/Loops.cpp
mlir/test/Dialect/Linalg/loop-order.mlir [new file with mode: 0644]