LLVM 20.0.0git
RegionsFromMetadata.h
Go to the documentation of this file.
1//===- RegionsFromMetadata.h ------------------------------------*- C++ -*-===//
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//
9// A SandboxIR function pass that builds regions from IR metadata and then runs
10// a pipeline of region passes on them. This is useful to test region passes in
11// isolation without relying on the output of the bottom-up vectorizer.
12//
13
14#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_REGIONSFROMMETADATA_H
15#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_REGIONSFROMMETADATA_H
16
17#include "llvm/ADT/StringRef.h"
18#include "llvm/SandboxIR/Pass.h"
20
21namespace llvm::sandboxir {
22
23class RegionsFromMetadata final : public FunctionPass {
24 // The PM containing the pipeline of region passes.
26
27public:
29 bool runOnFunction(Function &F, const Analyses &A) final;
30 void printPipeline(raw_ostream &OS) const final {
31 OS << getName() << "\n";
32 RPM.printPipeline(OS);
33 }
34};
35
36} // namespace llvm::sandboxir
37
38#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_REGIONSFROMMETADATA_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define F(x, y, z)
Definition: MD5.cpp:55
raw_pwrite_stream & OS
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
A pass that runs on a sandbox::Function.
Definition: Pass.h:71
StringRef getName() const
\Returns the name of the pass.
Definition: Pass.h:57
bool runOnFunction(Function &F, const Analyses &A) final
\Returns true if it modifies F.
void printPipeline(raw_ostream &OS) const final
Similar to print() but adds a newline. Used for testing.