Lower linalg.copy to LLVM dialect in the presence of transposes.
authorNicolas Vasilache <ntv@google.com>
Sat, 24 Aug 2019 00:44:55 +0000 (17:44 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Sat, 24 Aug 2019 00:45:19 +0000 (17:45 -0700)
commit46084c03f42f598f766028e63325dffd9d66b3d7
tree8713b835b11cc6620031eb9e52d4fc51dbaf5c7f
parent28e28e5d651b19a3f2a22c4fe4209a9d3d8c2689
Lower linalg.copy to LLVM dialect in the presence of transposes.

Add an extra RewritePattern that does not convert types to rewrite a CopyOp that has non-identity permutations into a sequence of TransposeOp followed by a CopyOp without such permutations.

This RewitePattern is made to fail in the non-permutation case so that the conversion pattern can kick in to lower to LLVM.

This is an instance of A->A->B lowering where A->A is done by a RewritePattern in case_1 and A->B is done by a ConversionPatternRewriter when not(case_1).

PiperOrigin-RevId: 265171380
mlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
mlir/test/Linalg/llvm.mlir