[win/asan] GetInstructionSize: Make `83 EC XX` a generic entry. (#119537)
[llvm-project.git] / mlir / test / lib / Dialect / MemRef / TestComposeSubView.cpp
blob02a9dbbe263f88cef08362f7603fd8eea69b9e99
1 //===- TestComposeSubView.cpp - Test composed subviews --------------------===//
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 a pass to test the composed subview patterns.
11 //===----------------------------------------------------------------------===//
13 #include "mlir/Dialect/Affine/IR/AffineOps.h"
14 #include "mlir/Dialect/MemRef/Transforms/ComposeSubView.h"
15 #include "mlir/Pass/Pass.h"
16 #include "mlir/Transforms/GreedyPatternRewriteDriver.h"
18 using namespace mlir;
20 namespace {
21 struct TestComposeSubViewPass
22 : public PassWrapper<TestComposeSubViewPass, OperationPass<>> {
23 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestComposeSubViewPass)
25 StringRef getArgument() const final { return "test-compose-subview"; }
26 StringRef getDescription() const final {
27 return "Test combining composed subviews";
29 void runOnOperation() override;
30 void getDependentDialects(DialectRegistry &registry) const override;
33 void TestComposeSubViewPass::getDependentDialects(
34 DialectRegistry &registry) const {
35 registry.insert<affine::AffineDialect>();
38 void TestComposeSubViewPass::runOnOperation() {
39 RewritePatternSet patterns(&getContext());
40 memref::populateComposeSubViewPatterns(patterns, &getContext());
41 (void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns));
43 } // namespace
45 namespace mlir {
46 namespace test {
47 void registerTestComposeSubView() {
48 PassRegistration<TestComposeSubViewPass>();
50 } // namespace test
51 } // namespace mlir