aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Conversion/VectorToArmSME/VectorToArmSMEPass.cpp
blob: 6d1bc71cf707f897fca5556c56e8964bcf1cd8f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===- VectorToArmSMEPass.cpp - Conversion from Vector to the ArmSME dialect =//
//
// 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/Conversion/VectorToArmSME/VectorToArmSME.h"

#include "mlir/Dialect/ArmSME/IR/ArmSME.h"
#include "mlir/Dialect/ArmSVE/IR/ArmSVEDialect.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"

namespace mlir {
#define GEN_PASS_DEF_CONVERTVECTORTOARMSMEPASS
#include "mlir/Conversion/Passes.h.inc"
} // namespace mlir

using namespace mlir;
using namespace mlir::vector;

namespace {
struct ConvertVectorToArmSMEPass
    : public impl::ConvertVectorToArmSMEPassBase<ConvertVectorToArmSMEPass> {

  void runOnOperation() override;
};
} // namespace

void ConvertVectorToArmSMEPass::runOnOperation() {
  RewritePatternSet patterns(&getContext());
  populateVectorToArmSMEPatterns(patterns, getContext());

  (void)applyPatternsGreedily(getOperation(), std::move(patterns));
}