[llvm] [SandboxVec] Add pass to create Regions from metadata. Generalize SandboxVec pass pipelines. (PR #112288)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 13:47:39 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);
----------------
vporpo wrote:
It's just that it forces you to initialize the pipeline when you define a pass.
https://github.com/llvm/llvm-project/pull/112288
More information about the llvm-commits
mailing list