MLIR
22.0.0git
lib
Conversion
TensorToLinalg
TensorToLinalg.cpp
Go to the documentation of this file.
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
16
#define DEBUG_TYPE "tensor-to-linalg-pattern"
17
18
using namespace
mlir
;
19
20
//===----------------------------------------------------------------------===//
21
// Pattern population
22
//===----------------------------------------------------------------------===//
23
24
void
mlir::populateTensorToLinalgPatterns
(
RewritePatternSet
&
patterns
) {
25
// TODO: Add the remaining patterns, e.g. to decompose Pack/Unpack Ops.
26
// Alternatively, delete this file.
27
patterns
.add<
mlir::linalg::DecomposePadOpPattern
>(
patterns
.getContext());
28
}
TensorToLinalg.h
mlir::RewritePatternSet
Definition:
PatternMatch.h:806
Transforms.h
mlir
Include the generated interface declarations.
Definition:
LocalAliasAnalysis.h:20
mlir::populateTensorToLinalgPatterns
void populateTensorToLinalgPatterns(RewritePatternSet &patterns)
Appends to a pattern list additional patterns for translating tensor ops to Linalg ops.
Definition:
TensorToLinalg.cpp:24
mlir::patterns
const FrozenRewritePatternSet & patterns
Definition:
GreedyPatternRewriteDriver.h:283
mlir::linalg::DecomposePadOpPattern
Rewrite a tensor::PadOp into a sequence of EmptyOp, FillOp and InsertSliceOp.
Definition:
Transforms.h:1638
Generated on Fri Sep 5 2025 16:33:10 for MLIR by
1.9.1