27void SandboxVectorizerPass::buildPipeline() {
35 "seed-collection<tr-save,bundle-vec(bottom-up),load-store-vec,"
36 "tr-accept-or-revert>",
66bool SandboxVectorizerPass::allowFile(
const std::string &SrcFilePath) {
70 size_t LastPos = DelimPos != 0 ? DelimPos + 1 : DelimPos;
72 auto FileNameToMatch =
73 Opts->sbvec_allow_files.substr(LastPos, DelimPos - LastPos);
74 if (FileNameToMatch.empty())
77 Regex FileNameRegex((
".*" + FileNameToMatch +
"$").str());
78 assert(FileNameRegex.isValid() &&
"Bad regex!");
79 if (FileNameRegex.match(SrcFilePath))
81 }
while (DelimPos != std::string::npos);
85bool SandboxVectorizerPass::runImpl(
Function &LLVMF) {
88 Ctx = std::make_unique<sandboxir::Context>(LLVMF.
getContext());
92 if (Opts->sbvec_print_pass_pipeline) {
93 FPM.printPipeline(
outs());
100 if (!allowFile(SrcFilePath))
105 if (!TTI->getNumberOfRegisters(TTI->getRegisterClassForType(
true))) {
107 <<
"Target has no vector registers, return.\n");
115 <<
"NoImplicitFloat attribute, return.\n");
120 sandboxir::Function &
F = *Ctx->createFunction(&LLVMF);
121 sandboxir::Analyses
A(*AA, *SE, *TTI);
122 bool Change = FPM.runOnFunction(
F,
A);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_UNLIKELY(EXPR)
Module.h This file contains the declarations for the Module class.
static constexpr char AllowFilesDelim
static const char * DefaultPipelineMagicStr
A magic string for the default pass pipeline.
A manager for alias analyses.
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.
Module * getParent()
Get the module that this global value is contained inside of...
LLVM_ABI cl::LibraryOptionsContext & getLibraryOptions() const
The library options this context reads in place of their process-wide values.
const std::string & getSourceFileName() const
Get the module's original source file name.
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.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
LLVM_ABI ~SandboxVectorizerPass()
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
LLVM_ABI SandboxVectorizerPass()
Analysis pass that exposes the ScalarEvolution for a function.
Analysis pass providing the TargetTransformInfo.
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
void setPassPipeline(StringRef Pipeline, CreatePassFunc CreatePass)
Parses Pipeline as a comma-separated sequence of pass names and sets the pass pipeline,...
static LLVM_ABI std::unique_ptr< FunctionPass > createFunctionPass(StringRef Name, StringRef Args, StringRef AuxArg)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.