[llvm] [SandboxVec] Add pass to create Regions from metadata. Generalize SandboxVec pass pipelines. (PR #112288)
Jorge Gorbe Moya via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 13:17:14 PDT 2024
================
@@ -0,0 +1,30 @@
+//===- RegionsFromMetadata.cpp - A helper to test RegionPasses -----------===//
+//
+// 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 "llvm/Transforms/Vectorize/SandboxVectorizer/Passes/RegionsFromMetadata.h"
+
+#include "llvm/SandboxIR/Region.h"
+#include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
+
+namespace llvm::sandboxir {
+
+RegionsFromMetadata::RegionsFromMetadata(StringRef Pipeline)
+ : FunctionPass("regions-from-metadata"), RPM("rpm") {
+ RPM.setPassPipeline(Pipeline, SandboxVectorizerPassBuilder::createRegionPass);
----------------
slackito wrote:
It's possible. Added a `PassManager(StringRef Name, StringRef Pipeline, CreatePassFunc CreatePass)` constructor to `PassManager` and similar ones to `FunctionPassManager` and `RegionPassManager`. Now both RegionsFromMetadata and BottomUpVec initialize the pipeline using the new RPM constructor
What's the advantage you see in doing so?
https://github.com/llvm/llvm-project/pull/112288
More information about the llvm-commits
mailing list