17#define SV_NAME "sandbox-vectorizer"
18#define DEBUG_TYPE SV_NAME
22 cl::desc(
"Prints the pass pipeline and returns."));
29 cl::desc(
"Comma-separated list of vectorizer passes. If not set "
30 "we run the predefined pipeline."));
57 bool Changed = runImpl(
F);
66bool SandboxVectorizerPass::runImpl(
Function &LLVMF) {
68 Ctx = std::make_unique<sandboxir::Context>(LLVMF.
getContext());
77 LLVM_DEBUG(
dbgs() <<
"SBVec: Target has no vector registers, return.\n");
83 LLVM_DEBUG(
dbgs() <<
"SBVec: NoImplicitFloat attribute, return.\n");
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static cl::opt< std::string > UserDefinedPassPipeline("sbvec-passes", cl::init(DefaultPipelineMagicStr), cl::Hidden, cl::desc("Comma-separated list of vectorizer passes. If not set " "we run the predefined pipeline."))
static const char * DefaultPipelineMagicStr
A magic string for the default pass pipeline.
static cl::opt< bool > PrintPassPipeline("sbvec-print-pass-pipeline", cl::init(false), cl::Hidden, cl::desc("Prints the pass pipeline and returns."))
A manager for alias analyses.
A container for analyses that lazily runs them and caches their results.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represents analyses that only rely on functions' control flow.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
void preserveSet()
Mark an analysis set as preserved.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Analysis pass that exposes the ScalarEvolution for a function.
Analysis pass providing the TargetTransformInfo.
StringRef getName() const
Return a constant reference to the value's name.
bool runOnFunction(Function &F, const Analyses &A) final
\Returns true if it modifies F.
void printPipeline(raw_ostream &OS) const override
Similar to print() but prints one pass per line. Used for testing.
void setPassPipeline(StringRef Pipeline, CreatePassFunc CreatePass)
Parses Pipeline as a comma-separated sequence of pass names and sets the pass pipeline,...
static std::unique_ptr< FunctionPass > createFunctionPass(StringRef Name, StringRef Args)
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.