[Mlir-commits] [mlir] [mlir][ArmSME] Add test-lower-to-arm-sme pipeline (PR #81732)

Cullen Rhodes llvmlistbot at llvm.org
Thu Feb 22 05:58:54 PST 2024


================
@@ -0,0 +1,99 @@
+//===- TestLowerToArmSME.cpp - Test lowering to ArmSME as a sink pass -----===//
+//
+// 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 implements a pass for testing the lowering to ArmSME as a
+// generally usable sink pass.
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Conversion/ArithToArmSME/ArithToArmSME.h"
+#include "mlir/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.h"
+#include "mlir/Conversion/ArmSMEToSCF/ArmSMEToSCF.h"
+#include "mlir/Conversion/VectorToArmSME/VectorToArmSME.h"
+#include "mlir/Conversion/VectorToSCF/VectorToSCF.h"
+#include "mlir/Dialect/ArmSME/Transforms/Passes.h"
+#include "mlir/Dialect/ArmSVE/Transforms/Passes.h"
+#include "mlir/IR/DialectRegistry.h"
+#include "mlir/Pass/Pass.h"
+#include "mlir/Pass/PassManager.h"
+#include "mlir/Pass/PassOptions.h"
+#include "mlir/Transforms/Passes.h"
+
+using namespace mlir;
+
+namespace {
+struct TestLowerToArmSMEOptions
+    : public PassPipelineOptions<TestLowerToArmSMEOptions> {
+  PassOptions::Option<bool> fuseOuterProducts{
+      *this, "fuse-outer-products",
+      llvm::cl::desc("Fuse outer product operations via "
+                     "'-arm-sme-outer-product-fusion' pass"),
+      llvm::cl::init(true)};
+};
+
----------------
c-rhodes wrote:

copy/pasting:
```
  // -arm-sme-vector-legalization -canonicalize -cse -convert-arith-to-arm-sme
  // -convert-vector-to-arm-sme -arm-sme-outer-product-fusion
  // -convert-arm-sme-to-scf -convert-vector-to-scf=full-unroll
  // -allocate-arm-sme-tiles
  // -enable-arm-streaming="streaming-mode=streaming-locally za-mode=new-za
  // only-if-required-by-ops" -convert-arm-sme-to-llvm -canonicalize -cse
```
seems less convenient than `-dump-pass-pipeline` to me. There's a bit of noise mostly from canonicalization options but it's not the end of the world.

https://github.com/llvm/llvm-project/pull/81732


More information about the Mlir-commits mailing list