[PATCH] D60814: [PassBuilder] promote pass-pipeline parsing API to public

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 23:21:56 PDT 2019


fedor.sergeev created this revision.
fedor.sergeev added reviewers: philip.pfaffe, chandlerc.
Herald added a project: LLVM.

While currently available pipeline parsing API (PassBuilder::parsePassPipeline)
is enough for parsing textual representation of a default pipeline,
it becomes insufficient when parsing pipelines for complex custom passes/pass
managers that take nested pipelines. This parsing is being performed by callbacks
(e.g. moudle pipeline parsing callback) which are passed the pass name + array of
pre-parsed pipeline elements. Now after matching the name in callback user has to
process pipeline elements and there is no public API for that.

Whe have methods that take ArrayRef<PipelineElement> - parse*PassPipeline,
but these methods are private.

Just promoting these APIs to public.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60814

Files:
  llvm/include/llvm/Passes/PassBuilder.h


Index: llvm/include/llvm/Passes/PassBuilder.h
===================================================================
--- llvm/include/llvm/Passes/PassBuilder.h
+++ llvm/include/llvm/Passes/PassBuilder.h
@@ -592,6 +592,18 @@
     TopLevelPipelineParsingCallbacks.push_back(C);
   }
 
+  Error parseLoopPassPipeline(LoopPassManager &LPM,
+                              ArrayRef<PipelineElement> Pipeline,
+                              bool VerifyEachPass, bool DebugLogging);
+  Error parseFunctionPassPipeline(FunctionPassManager &FPM,
+                                  ArrayRef<PipelineElement> Pipeline,
+                                  bool VerifyEachPass, bool DebugLogging);
+  Error parseCGSCCPassPipeline(CGSCCPassManager &CGPM,
+                               ArrayRef<PipelineElement> Pipeline,
+                               bool VerifyEachPass, bool DebugLogging);
+  Error parseModulePassPipeline(ModulePassManager &MPM,
+                                ArrayRef<PipelineElement> Pipeline,
+                                bool VerifyEachPass, bool DebugLogging);
 private:
   static Optional<std::vector<PipelineElement>>
   parsePipelineText(StringRef Text);
@@ -606,19 +618,6 @@
                       bool VerifyEachPass, bool DebugLogging);
   bool parseAAPassName(AAManager &AA, StringRef Name);
 
-  Error parseLoopPassPipeline(LoopPassManager &LPM,
-                              ArrayRef<PipelineElement> Pipeline,
-                              bool VerifyEachPass, bool DebugLogging);
-  Error parseFunctionPassPipeline(FunctionPassManager &FPM,
-                                  ArrayRef<PipelineElement> Pipeline,
-                                  bool VerifyEachPass, bool DebugLogging);
-  Error parseCGSCCPassPipeline(CGSCCPassManager &CGPM,
-                               ArrayRef<PipelineElement> Pipeline,
-                               bool VerifyEachPass, bool DebugLogging);
-  Error parseModulePassPipeline(ModulePassManager &MPM,
-                                ArrayRef<PipelineElement> Pipeline,
-                                bool VerifyEachPass, bool DebugLogging);
-
   void addPGOInstrPasses(ModulePassManager &MPM, bool DebugLogging,
                          OptimizationLevel Level, bool RunProfileGen, bool IsCS,
                          std::string ProfileFile,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60814.195513.patch
Type: text/x-patch
Size: 2318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190417/a3d335fb/attachment.bin>


More information about the llvm-commits mailing list