LLVM 24.0.0git
SandboxVectorizer.h
Go to the documentation of this file.
1//===- SandboxVectorizer.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#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_SANDBOXVECTORIZER_H
9#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_SANDBOXVECTORIZER_H
10
12#include <memory>
13
16#include "llvm/IR/PassManager.h"
19
20namespace llvm {
21
23struct VectorizeOptions;
24
26 : public OptionalPassInfoMixin<SandboxVectorizerPass> {
27 const VectorizeOptions *Opts = nullptr;
28 TargetTransformInfo *TTI = nullptr;
29 AAResults *AA = nullptr;
30 ScalarEvolution *SE = nullptr;
31 // NOTE: We define the Context as a pass-scope object instead of local object
32 // in runOnFunction() because the passes defined in the pass-manager need
33 // access to it for registering/deregistering callbacks during construction
34 // and destruction.
35 std::unique_ptr<sandboxir::Context> Ctx;
36
37 // A pipeline of SandboxIR function passes run by the vectorizer.
38 // NOTE: We define this as a pass-scope object to avoid recreating the
39 // pass-pipeline every time in runOnFunction(). The downside is that the
40 // Context also needs to be defined as a pass-scope object because the passes
41 // within FPM may register/unregister callbacks, so they need access to
42 // Context.
44 /// \Returns true if we should attempt to vectorize \p SrcFilePath based on
45 /// `AllowFiles` option.
46 bool allowFile(const std::string &SrcFilePath);
47
48 void buildPipeline();
49 bool runImpl(Function &F);
50
51public:
52 // Make sure the constructors/destructors are out-of-line. This works around a
53 // problem with -DBUILD_SHARED_LIBS=on where components that depend on the
54 // Vectorizer component can't find the vtable for classes like
55 // sandboxir::Pass. This way we don't have to make LLVMPasses add a direct
56 // dependency on SandboxIR.
60
62};
63
64} // namespace llvm
65
66#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_SANDBOXVECTORIZER_H
#define LLVM_ABI
Definition Compiler.h:215
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
LLVM_ABI SandboxVectorizerPass(SandboxVectorizerPass &&)
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
The main scalar evolution driver.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
A CRTP mix-in for passes that can be skipped.