1*1dce51b8STres Popp //===- TensorToLinalg.cpp - Tensor to Linalg Patterns ---------------------===// 2*1dce51b8STres Popp // 3*1dce51b8STres Popp // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*1dce51b8STres Popp // See https://llvm.org/LICENSE.txt for license information. 5*1dce51b8STres Popp // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*1dce51b8STres Popp // 7*1dce51b8STres Popp //===----------------------------------------------------------------------===// 8*1dce51b8STres Popp // 9*1dce51b8STres Popp // This file implements patterns to convert Tensor dialect to Linalg dialect. 10*1dce51b8STres Popp // 11*1dce51b8STres Popp //===----------------------------------------------------------------------===// 12*1dce51b8STres Popp 13*1dce51b8STres Popp #include "mlir/Conversion/TensorToLinalg/TensorToLinalg.h" 14*1dce51b8STres Popp #include "mlir/Dialect/Linalg/Transforms/Transforms.h" 15*1dce51b8STres Popp #include "mlir/Dialect/Tensor/IR/Tensor.h" 16*1dce51b8STres Popp #include "mlir/IR/AffineMap.h" 17*1dce51b8STres Popp #include "mlir/Support/LogicalResult.h" 18*1dce51b8STres Popp #include "llvm/ADT/SetVector.h" 19*1dce51b8STres Popp #include "llvm/Support/Debug.h" 20*1dce51b8STres Popp 21*1dce51b8STres Popp #define DEBUG_TYPE "tensor-to-linalg-pattern" 22*1dce51b8STres Popp 23*1dce51b8STres Popp using namespace mlir; 24*1dce51b8STres Popp 25*1dce51b8STres Popp //===----------------------------------------------------------------------===// 26*1dce51b8STres Popp // Pattern population 27*1dce51b8STres Popp //===----------------------------------------------------------------------===// 28*1dce51b8STres Popp populateTensorToLinalgPatterns(RewritePatternSet & patterns)29*1dce51b8STres Poppvoid mlir::populateTensorToLinalgPatterns(RewritePatternSet &patterns) { 30*1dce51b8STres Popp patterns.add<mlir::linalg::GeneralizePadOpPattern>(patterns.getContext()); 31*1dce51b8STres Popp } 32