//===- ComposeSubView.cpp - Combining composed subview 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 // //===----------------------------------------------------------------------===// // // This file contains patterns for combining composed subview ops (i.e. subview // of a subview becomes a single subview). // //===----------------------------------------------------------------------===// #include "mlir/Dialect/MemRef/Transforms/ComposeSubView.h" #include "mlir/Dialect/Affine/IR/AffineOps.h" #include "mlir/Dialect/MemRef/IR/MemRef.h" #include "mlir/IR/BuiltinAttributes.h" #include "mlir/IR/OpDefinition.h" #include "mlir/IR/PatternMatch.h" #include "mlir/Transforms/DialectConversion.h" #include "mlir/Transforms/GreedyPatternRewriteDriver.h" usingnamespacemlir; namespace { // Replaces a subview of a subview with a single subview(both static and dynamic // offsets are supported). struct ComposeSubViewOpPattern : public OpRewritePattern<memref::SubViewOp> { … }; } // namespace void mlir::memref::populateComposeSubViewPatterns(RewritePatternSet &patterns, MLIRContext *context) { … }