xref: /llvm-project/mlir/include/mlir/Dialect/Tensor/Transforms/Passes.td (revision debdbeda15802900615d1bee83e4fc519abeaba6)
1//===-- Passes.td - pass definition file -------------------*- tablegen -*-===//
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#ifndef MLIR_DIALECT_TENSOR_TRANSFORMS_PASSES
10#define MLIR_DIALECT_TENSOR_TRANSFORMS_PASSES
11
12include "mlir/Pass/PassBase.td"
13
14def FoldTensorSubsetOps : Pass<"fold-tensor-subset-ops"> {
15  let summary = "Fold tensor subset ops into producer/consumer ops";
16  let description = [{
17    The pass folds tensor subset ops into producer/consumer ops.
18
19    At the moment, the following foldings occur when possible:
20      - tensor.extract_slice into vector.transfer_read
21      - vector.transfer_write into tensor.insert_slice
22
23  }];
24  let constructor = "mlir::tensor::createFoldTensorSubsetOpsPass()";
25  let dependentDialects = [
26      "affine::AffineDialect", "tensor::TensorDialect", "vector::VectorDialect"
27  ];
28}
29
30#endif // MLIR_DIALECT_TENSOR_TRANSFORMS_PASSES
31