xref: /llvm-project/mlir/lib/Conversion/TensorToLinalg/TensorToLinalg.cpp (revision 1b2c8f104f9c6f26500ab608060bbc6b7f40f5e1)
11dce51b8STres Popp //===- TensorToLinalg.cpp - Tensor to Linalg Patterns ---------------------===//
21dce51b8STres Popp //
31dce51b8STres Popp // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
41dce51b8STres Popp // See https://llvm.org/LICENSE.txt for license information.
51dce51b8STres Popp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
61dce51b8STres Popp //
71dce51b8STres Popp //===----------------------------------------------------------------------===//
81dce51b8STres Popp //
91dce51b8STres Popp // This file implements patterns to convert Tensor dialect to Linalg dialect.
101dce51b8STres Popp //
111dce51b8STres Popp //===----------------------------------------------------------------------===//
121dce51b8STres Popp 
131dce51b8STres Popp #include "mlir/Conversion/TensorToLinalg/TensorToLinalg.h"
141dce51b8STres Popp #include "mlir/Dialect/Linalg/Transforms/Transforms.h"
151dce51b8STres Popp #include "mlir/Dialect/Tensor/IR/Tensor.h"
161dce51b8STres Popp #include "mlir/IR/AffineMap.h"
171dce51b8STres Popp #include "llvm/Support/Debug.h"
181dce51b8STres Popp 
191dce51b8STres Popp #define DEBUG_TYPE "tensor-to-linalg-pattern"
201dce51b8STres Popp 
211dce51b8STres Popp using namespace mlir;
221dce51b8STres Popp 
231dce51b8STres Popp //===----------------------------------------------------------------------===//
241dce51b8STres Popp // Pattern population
251dce51b8STres Popp //===----------------------------------------------------------------------===//
261dce51b8STres Popp 
271dce51b8STres Popp void mlir::populateTensorToLinalgPatterns(RewritePatternSet &patterns) {
28*1b2c8f10SAndrzej Warzyński   // TODO: Add the remaining patterns, e.g. to decompose Pack/Unpack Ops.
29*1b2c8f10SAndrzej Warzyński   // Alternatively, delete this file.
30*1b2c8f10SAndrzej Warzyński   patterns.add<mlir::linalg::DecomposePadOpPattern>(patterns.getContext());
311dce51b8STres Popp }
32