LLVM 24.0.0git
SeedCollection.h
Go to the documentation of this file.
1//===- SeedCollection.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// The seed-collection pass of the bundle vectorizer.
10//
11
12#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SEEDCOLLECTION_H
13#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SEEDCOLLECTION_H
14
15#include "llvm/SandboxIR/Pass.h"
17
18namespace llvm::sandboxir {
19
20/// This pass collects the instructions that can become vectorization "seeds",
21/// like stores to consecutive memory addresses. It then goes over the collected
22/// seeds, slicing them into appropriately sized chunks, creating a Region with
23/// the seed slice as the Auxiliary vector and runs the region pass pipeline.
24class LLVM_ABI SeedCollection final : public FunctionPass {
25
26 /// The PM containing the pipeline of region passes.
28 /// The auxiliary argument passed to the pass that tells us that we should
29 /// collect seeds of different types.
30 AuxPassArgsRegistry ArgsRegistry;
31 AuxPassArg AllowDiffTypes = ArgsRegistry.createArg("enable-diff-types");
32 AuxPassArg CollectLoads = ArgsRegistry.createArg("loads");
33 AuxPassArg CollectStores = ArgsRegistry.createArg("stores");
34
35public:
36 SeedCollection(StringRef Pipeline, StringRef AuxArg);
37 bool runOnFunction(Function &F, const Analyses &A) final;
38 void printPipeline(raw_ostream &OS) const final {
39 OS << getName() << "\n";
40 RPM.printPipeline(OS);
41 }
42};
43
44} // namespace llvm::sandboxir
45
46#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_SEEDCOLLECTION_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_ABI
Definition Compiler.h:215
static bool runOnFunction(Function &F, bool PostInlining)
#define F(x, y, z)
Definition MD5.cpp:54
static StringRef getName(Value *V)
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This represents an auxiliary pass argument.
Definition Pass.h:96
A registry for the auxiliary pass argument arguments.
Definition Pass.h:121
FunctionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
Definition Pass.h:79
void printPipeline(raw_ostream &OS) const final
Similar to print() but adds a newline. Used for testing.
SeedCollection(StringRef Pipeline, StringRef AuxArg)