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