[Mlir-commits] [mlir] [mlir][ArmSME] Add constructor for `-convert-vector-to-arm-sme` pass (NFC) (PR #71705)

Benjamin Maxwell llvmlistbot at llvm.org
Wed Nov 8 09:18:45 PST 2023


https://github.com/MacDue created https://github.com/llvm/llvm-project/pull/71705

This will be needed to construct the pass downstream (i.e. in IREE).

>From b2ecd88ac8dfcc19b42019d122c4070eef798bf0 Mon Sep 17 00:00:00 2001
From: Benjamin Maxwell <benjamin.maxwell at arm.com>
Date: Wed, 8 Nov 2023 17:14:58 +0000
Subject: [PATCH] [mlir][ArmSME] Add constructor for
 `-convert-vector-to-arm-sme` pass (NFC)

This will be needed to construct the pass downstream (i.e. in IREE).
---
 mlir/include/mlir/Conversion/Passes.td                       | 1 +
 mlir/include/mlir/Conversion/VectorToArmSME/VectorToArmSME.h | 3 +++
 mlir/lib/Conversion/VectorToArmSME/VectorToArmSMEPass.cpp    | 4 ++++
 3 files changed, 8 insertions(+)

diff --git a/mlir/include/mlir/Conversion/Passes.td b/mlir/include/mlir/Conversion/Passes.td
index 8b64f6dbe741b93..fce168d6ce09f47 100644
--- a/mlir/include/mlir/Conversion/Passes.td
+++ b/mlir/include/mlir/Conversion/Passes.td
@@ -1204,6 +1204,7 @@ def ConvertVectorToSCF : Pass<"convert-vector-to-scf"> {
 def ConvertVectorToArmSME : Pass<"convert-vector-to-arm-sme"> {
   let summary = "Lower the operations from the vector dialect into the ArmSME "
                 "dialect";
+  let constructor = "mlir::createConvertVectorToArmSMEPass()";
   let description = [{
     Pass that converts vector dialect operations into equivalent ArmSME dialect
     operations.
diff --git a/mlir/include/mlir/Conversion/VectorToArmSME/VectorToArmSME.h b/mlir/include/mlir/Conversion/VectorToArmSME/VectorToArmSME.h
index 2108e485dae7ba7..2332311ee72cdff 100644
--- a/mlir/include/mlir/Conversion/VectorToArmSME/VectorToArmSME.h
+++ b/mlir/include/mlir/Conversion/VectorToArmSME/VectorToArmSME.h
@@ -21,6 +21,9 @@ class Pass;
 void populateVectorToArmSMEPatterns(RewritePatternSet &patterns,
                                     MLIRContext &ctx);
 
+/// Create a pass to lower operations from the vector dialect to Arm SME.
+std::unique_ptr<Pass> createConvertVectorToArmSMEPass();
+
 } // namespace mlir
 
 #endif // MLIR_CONVERSION_VECTORTOARMSME_VECTORTOARMSME_H_
diff --git a/mlir/lib/Conversion/VectorToArmSME/VectorToArmSMEPass.cpp b/mlir/lib/Conversion/VectorToArmSME/VectorToArmSMEPass.cpp
index 92025e9fbe82d3e..2601f31be11a32c 100644
--- a/mlir/lib/Conversion/VectorToArmSME/VectorToArmSMEPass.cpp
+++ b/mlir/lib/Conversion/VectorToArmSME/VectorToArmSMEPass.cpp
@@ -34,3 +34,7 @@ void ConvertVectorToArmSMEPass::runOnOperation() {
 
   (void)applyPatternsAndFoldGreedily(getOperation(), std::move(patterns));
 }
+
+std::unique_ptr<Pass> mlir::createConvertVectorToArmSMEPass() {
+  return std::make_unique<ConvertVectorToArmSMEPass>();
+}



More information about the Mlir-commits mailing list