MLIR  19.0.0git
VectorToArmSMEPass.cpp
Go to the documentation of this file.
1 //===- VectorToArmSMEPass.cpp - Conversion from Vector to the ArmSME dialect =//
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 
10 
12 #include "mlir/Pass/Pass.h"
14 
15 namespace mlir {
16 #define GEN_PASS_DEF_CONVERTVECTORTOARMSME
17 #include "mlir/Conversion/Passes.h.inc"
18 } // namespace mlir
19 
20 using namespace mlir;
21 using namespace mlir::vector;
22 
23 namespace {
24 struct ConvertVectorToArmSMEPass
25  : public impl::ConvertVectorToArmSMEBase<ConvertVectorToArmSMEPass> {
26 
27  void runOnOperation() override;
28 };
29 } // namespace
30 
31 void ConvertVectorToArmSMEPass::runOnOperation() {
32  RewritePatternSet patterns(&getContext());
34 
35  (void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns));
36 }
37 
38 std::unique_ptr<Pass> mlir::createConvertVectorToArmSMEPass() {
39  return std::make_unique<ConvertVectorToArmSMEPass>();
40 }
static MLIRContext * getContext(OpFoldResult val)
Include the generated interface declarations.
std::unique_ptr< Pass > createConvertVectorToArmSMEPass()
Create a pass to lower operations from the vector dialect to Arm SME.
LogicalResult applyPatternsAndFoldGreedily(Region &region, const FrozenRewritePatternSet &patterns, GreedyRewriteConfig config=GreedyRewriteConfig(), bool *changed=nullptr)
Rewrite ops in the given region, which must be isolated from above, by repeatedly applying the highes...
void populateVectorToArmSMEPatterns(RewritePatternSet &patterns, MLIRContext &ctx)
Collect a set of patterns to lower Vector ops to ArmSME ops that map to LLVM intrinsics.