LLVM 22.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
22class TargetTransformInfo;
23
24class SandboxVectorizerPass : public PassInfoMixin<SandboxVectorizerPass> {
25 TargetTransformInfo *TTI = nullptr;
26 AAResults *AA = nullptr;
27 ScalarEvolution *SE = nullptr;
28 // NOTE: We define the Context as a pass-scope object instead of local object
29 // in runOnFunction() because the passes defined in the pass-manager need
30 // access to it for registering/deregistering callbacks during construction
31 // and destruction.
32 std::unique_ptr<sandboxir::Context> Ctx;
33
34 // A pipeline of SandboxIR function passes run by the vectorizer.
35 // NOTE: We define this as a pass-scope object to avoid recreating the
36 // pass-pipeline every time in runOnFunction(). The downside is that the
37 // Context also needs to be defined as a pass-scope object because the passes
38 // within FPM may register/unregister callbacks, so they need access to
39 // Context.
41 /// \Returns true if we should attempt to vectorize \p SrcFilePath based on
42 /// `AllowFiles` option.
43 bool allowFile(const std::string &SrcFilePath);
44
45 bool runImpl(Function &F);
46
47public:
48 // Make sure the constructors/destructors are out-of-line. This works around a
49 // problem with -DBUILD_SHARED_LIBS=on where components that depend on the
50 // Vectorizer component can't find the vtable for classes like
51 // sandboxir::Pass. This way we don't have to make LLVMPasses add a direct
52 // dependency on SandboxIR.
56
58};
59
60} // namespace llvm
61
62#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_SANDBOXVECTORIZER_H
#define LLVM_ABI
Definition: Compiler.h:213
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition: MD5.cpp:55
A private abstract base class describing the concept of an individual alias analysis implementation.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:255
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.
Definition: AddressRanges.h:18
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:70