#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;
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> { … };
}
void tensor::registerFindPayloadReplacementOpInterfaceExternalModels(
DialectRegistry ®istry) { … }
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) { … }
void transform::TypeConversionCastShapeDynamicDimsOp::
populateTypeMaterializations(TypeConverter &converter) { … }
DiagnosedSilenceableFailure transform::MakeLoopIndependentOp::applyToOne(
transform::TransformRewriter &rewriter, Operation *target,
transform::ApplyToEachResultList &results,
transform::TransformState &state) { … }
namespace {
class TensorTransformDialectExtension
: public transform::TransformDialectExtension<
TensorTransformDialectExtension> { … };
}
#define GET_OP_CLASSES
#include "mlir/Dialect/Tensor/TransformOps/TensorTransformOps.cpp.inc"
void mlir::tensor::registerTransformDialectExtension(
DialectRegistry ®istry) { … }