llvm/mlir/lib/Dialect/Tensor/TransformOps/TensorTransformOps.cpp

//===- TensorTransformOps.cpp - Implementation of tensor transform ops ----===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "mlir/Dialect/Tensor/TransformOps/TensorTransformOps.h"

#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Dialect/Tensor/Transforms/Transforms.h"
#include "mlir/Dialect/Tensor/Utils/Utils.h"
#include "mlir/Dialect/Transform/IR/TransformDialect.h"
#include "mlir/Dialect/Transform/Interfaces/TransformInterfaces.h"
#include "mlir/IR/Builders.h"
#include "mlir/Transforms/DialectConversion.h"

usingnamespacemlir;
usingnamespacetensor;

//===----------------------------------------------------------------------===//
// FindPayloadReplacementOpInterface implementations
//===----------------------------------------------------------------------===//

namespace {
struct ExtractSliceOpReplacementInterface
    : public transform::FindPayloadReplacementOpInterface::ExternalModel<
          ExtractSliceOpReplacementInterface, tensor::ExtractSliceOp> {};

struct InsertSliceOpReplacementInterface
    : public transform::FindPayloadReplacementOpInterface::ExternalModel<
          InsertSliceOpReplacementInterface, tensor::InsertSliceOp> {};

struct ReshapeOpReplacementInterface
    : public transform::FindPayloadReplacementOpInterface::ExternalModel<
          ReshapeOpReplacementInterface, tensor::ReshapeOp> {};

template <typename ConcreteOp>
struct ReassociativeReshapeOpReplacementInterface
    : public transform::FindPayloadReplacementOpInterface::ExternalModel<
          ReassociativeReshapeOpReplacementInterface<ConcreteOp>, ConcreteOp> {};
} // namespace

void tensor::registerFindPayloadReplacementOpInterfaceExternalModels(
    DialectRegistry &registry) {}

//===----------------------------------------------------------------------===//
// Apply...PatternsOp
//===----------------------------------------------------------------------===//

void transform::ApplyDecomposeTensorConcatPatternsOp::populatePatterns(
    RewritePatternSet &patterns) {}

void transform::ApplyDropRedundantInsertSliceRankExpansionPatternsOp::
    populatePatterns(RewritePatternSet &patterns) {}

void transform::ApplyFoldTensorEmptyPatternsOp::populatePatterns(
    RewritePatternSet &patterns) {}

void transform::ApplyFoldIntoPackAndUnpackPatternsOp::populatePatterns(
    RewritePatternSet &patterns) {}

void transform::ApplyFoldTensorSubsetOpsPatternsOp::populatePatterns(
    RewritePatternSet &patterns) {}

void transform::ApplyFoldTensorSubsetOpsIntoVectorTransfersPatternsOp::
    populatePatterns(RewritePatternSet &patterns) {}

void transform::ApplyMergeConsecutiveInsertExtractSlicePatternsOp::
    populatePatterns(RewritePatternSet &patterns) {}

void transform::ApplyReassociativeReshapeFoldingPatternsOp::populatePatterns(
    RewritePatternSet &patterns) {}

void transform::ApplyRewriteTensorOpsAsConstantPatternsOp::populatePatterns(
    RewritePatternSet &patterns) {}

//===----------------------------------------------------------------------===//
// TypeConversionCastTensorShapeOp
//===----------------------------------------------------------------------===//

void transform::TypeConversionCastShapeDynamicDimsOp::
    populateTypeMaterializations(TypeConverter &converter) {}

//===----------------------------------------------------------------------===//
// MakeLoopIndependentOp
//===----------------------------------------------------------------------===//

DiagnosedSilenceableFailure transform::MakeLoopIndependentOp::applyToOne(
    transform::TransformRewriter &rewriter, Operation *target,
    transform::ApplyToEachResultList &results,
    transform::TransformState &state) {}

//===----------------------------------------------------------------------===//
// Transform op registration
//===----------------------------------------------------------------------===//

namespace {
class TensorTransformDialectExtension
    : public transform::TransformDialectExtension<
          TensorTransformDialectExtension> {};
} // namespace

#define GET_OP_CLASSES
#include "mlir/Dialect/Tensor/TransformOps/TensorTransformOps.cpp.inc"

void mlir::tensor::registerTransformDialectExtension(
    DialectRegistry &registry) {}