diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h --- a/llvm/include/llvm/Analysis/AliasAnalysis.h +++ b/llvm/include/llvm/Analysis/AliasAnalysis.h @@ -1165,6 +1165,8 @@ Result run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "aa"; } + private: friend AnalysisInfoMixin; diff --git a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h --- a/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h +++ b/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h @@ -58,6 +58,8 @@ /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "aa-eval"; } + private: // Allow the legacy pass to run this using an internal API. friend class AAEvalLegacyPass; diff --git a/llvm/include/llvm/Analysis/AliasSetTracker.h b/llvm/include/llvm/Analysis/AliasSetTracker.h --- a/llvm/include/llvm/Analysis/AliasSetTracker.h +++ b/llvm/include/llvm/Analysis/AliasSetTracker.h @@ -467,6 +467,7 @@ public: explicit AliasSetsPrinterPass(raw_ostream &OS); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print-alias-sets"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/AssumptionCache.h b/llvm/include/llvm/Analysis/AssumptionCache.h --- a/llvm/include/llvm/Analysis/AssumptionCache.h +++ b/llvm/include/llvm/Analysis/AssumptionCache.h @@ -177,6 +177,8 @@ AssumptionCache run(Function &F, FunctionAnalysisManager &) { return AssumptionCache(F); } + + static StringRef name() { return "assumptions"; } }; /// Printer pass for the \c AssumptionAnalysis results. @@ -187,6 +189,8 @@ explicit AssumptionPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// An immutable pass that tracks lazily created \c AssumptionCache diff --git a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h --- a/llvm/include/llvm/Analysis/BasicAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/BasicAliasAnalysis.h @@ -252,6 +252,8 @@ using Result = BasicAAResult; BasicAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "basic-aa"; } }; /// Legacy wrapper pass to provide the BasicAAResult object. diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h --- a/llvm/include/llvm/Analysis/BlockFrequencyInfo.h +++ b/llvm/include/llvm/Analysis/BlockFrequencyInfo.h @@ -121,6 +121,8 @@ /// Run the analysis pass over a function and produce BFI. Result run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "block-freq"; } }; /// Printer pass for the \c BlockFrequencyInfo results. @@ -132,6 +134,8 @@ explicit BlockFrequencyPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// Legacy analysis pass which computes \c BlockFrequencyInfo. diff --git a/llvm/include/llvm/Analysis/BranchProbabilityInfo.h b/llvm/include/llvm/Analysis/BranchProbabilityInfo.h --- a/llvm/include/llvm/Analysis/BranchProbabilityInfo.h +++ b/llvm/include/llvm/Analysis/BranchProbabilityInfo.h @@ -429,6 +429,8 @@ /// Run the analysis pass over a function and produce BPI. BranchProbabilityInfo run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "branch-prob"; } }; /// Printer pass for the \c BranchProbabilityAnalysis results. @@ -440,6 +442,8 @@ explicit BranchProbabilityPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// Legacy analysis pass which computes \c BranchProbabilityInfo. diff --git a/llvm/include/llvm/Analysis/CFGPrinter.h b/llvm/include/llvm/Analysis/CFGPrinter.h --- a/llvm/include/llvm/Analysis/CFGPrinter.h +++ b/llvm/include/llvm/Analysis/CFGPrinter.h @@ -34,21 +34,25 @@ class CFGViewerPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "view-cfg"; } }; class CFGOnlyViewerPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "view-cfg-only"; } }; class CFGPrinterPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "dot-cfg"; } }; class CFGOnlyPrinterPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "dot-cfg-only"; } }; class DOTFuncInfo { diff --git a/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h --- a/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/CFLAndersAliasAnalysis.h @@ -100,6 +100,8 @@ using Result = CFLAndersAAResult; CFLAndersAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "cfl-anders-aa"; } }; /// Legacy wrapper pass to provide the CFLAndersAAResult object. diff --git a/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h b/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h --- a/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/CFLSteensAliasAnalysis.h @@ -117,6 +117,8 @@ using Result = CFLSteensAAResult; CFLSteensAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "cfl-steens-aa"; } }; /// Legacy wrapper pass to provide the CFLSteensAAResult object. diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h --- a/llvm/include/llvm/Analysis/CGSCCPassManager.h +++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h @@ -161,6 +161,7 @@ (void)AM.template getResult(C, CG); return PreservedAnalyses::all(); } + static StringRef name() { return "require-analysis"; } }; /// A proxy from a \c CGSCCAnalysisManager to a \c Module. @@ -364,6 +365,7 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "module-to-post-order-cgscc-adaptor"; } private: std::unique_ptr Pass; @@ -414,6 +416,8 @@ /// Computes the \c FunctionAnalysisManager and stores it in the result proxy. Result run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &); + static StringRef name() { return "fam-proxy"; } + private: friend AnalysisInfoMixin; @@ -482,6 +486,7 @@ LazyCallGraph &CG, CGSCCUpdateResult &UR); static bool isRequired() { return true; } + static StringRef name() { return "cgscc-to-function-adaptor"; } private: std::unique_ptr Pass; @@ -528,6 +533,8 @@ PreservedAnalyses run(LazyCallGraph::SCC &InitialC, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); + static StringRef name() { return "devirt-repeat"; } + private: std::unique_ptr Pass; int MaxIterations; diff --git a/llvm/include/llvm/Analysis/CallGraph.h b/llvm/include/llvm/Analysis/CallGraph.h --- a/llvm/include/llvm/Analysis/CallGraph.h +++ b/llvm/include/llvm/Analysis/CallGraph.h @@ -315,6 +315,8 @@ /// /// The real work here is done in the \c CallGraph constructor. CallGraph run(Module &M, ModuleAnalysisManager &) { return CallGraph(M); } + + static StringRef name() { return "callgraph"; } }; /// Printer pass for the \c CallGraphAnalysis results. @@ -325,6 +327,7 @@ explicit CallGraphPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-callgraph"; } }; /// The \c ModulePass which wraps up a \c CallGraph and the logic to diff --git a/llvm/include/llvm/Analysis/DDG.h b/llvm/include/llvm/Analysis/DDG.h --- a/llvm/include/llvm/Analysis/DDG.h +++ b/llvm/include/llvm/Analysis/DDG.h @@ -426,6 +426,7 @@ public: using Result = std::unique_ptr; Result run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR); + static StringRef name() { return "ddg"; } private: friend AnalysisInfoMixin; @@ -439,6 +440,8 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "print"; } + private: raw_ostream &OS; }; diff --git a/llvm/include/llvm/Analysis/DDGPrinter.h b/llvm/include/llvm/Analysis/DDGPrinter.h --- a/llvm/include/llvm/Analysis/DDGPrinter.h +++ b/llvm/include/llvm/Analysis/DDGPrinter.h @@ -28,6 +28,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "dot-ddg"; } }; //===--------------------------------------------------------------------===// diff --git a/llvm/include/llvm/Analysis/Delinearization.h b/llvm/include/llvm/Analysis/Delinearization.h --- a/llvm/include/llvm/Analysis/Delinearization.h +++ b/llvm/include/llvm/Analysis/Delinearization.h @@ -25,6 +25,8 @@ explicit DelinearizationPrinterPass(raw_ostream &OS); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print"; } + private: raw_ostream &OS; }; diff --git a/llvm/include/llvm/Analysis/DemandedBits.h b/llvm/include/llvm/Analysis/DemandedBits.h --- a/llvm/include/llvm/Analysis/DemandedBits.h +++ b/llvm/include/llvm/Analysis/DemandedBits.h @@ -129,6 +129,8 @@ /// Run the analysis pass over a function and produce demanded bits /// information. DemandedBits run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "demanded-bits"; } }; /// Printer pass for DemandedBits @@ -139,6 +141,8 @@ explicit DemandedBitsPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// Create a demanded bits analysis pass. diff --git a/llvm/include/llvm/Analysis/DependenceAnalysis.h b/llvm/include/llvm/Analysis/DependenceAnalysis.h --- a/llvm/include/llvm/Analysis/DependenceAnalysis.h +++ b/llvm/include/llvm/Analysis/DependenceAnalysis.h @@ -958,6 +958,7 @@ public: typedef DependenceInfo Result; Result run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "da"; } private: static AnalysisKey Key; @@ -971,6 +972,8 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "print"; } + private: raw_ostream &OS; }; // class DependenceAnalysisPrinterPass diff --git a/llvm/include/llvm/Analysis/DivergenceAnalysis.h b/llvm/include/llvm/Analysis/DivergenceAnalysis.h --- a/llvm/include/llvm/Analysis/DivergenceAnalysis.h +++ b/llvm/include/llvm/Analysis/DivergenceAnalysis.h @@ -203,6 +203,8 @@ /// Runs the divergence analysis on @F, a GPU kernel Result run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "divergence"; } }; /// Printer pass to dump divergence analysis results. @@ -212,6 +214,8 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "print"; } + private: raw_ostream &OS; }; // class DivergenceAnalysisPrinterPass diff --git a/llvm/include/llvm/Analysis/DominanceFrontier.h b/llvm/include/llvm/Analysis/DominanceFrontier.h --- a/llvm/include/llvm/Analysis/DominanceFrontier.h +++ b/llvm/include/llvm/Analysis/DominanceFrontier.h @@ -191,6 +191,8 @@ /// Run the analysis pass over a function and produce a dominator tree. DominanceFrontier run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "domfrontier"; } }; /// Printer pass for the \c DominanceFrontier. @@ -202,6 +204,8 @@ explicit DominanceFrontierPrinterPass(raw_ostream &OS); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h --- a/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h +++ b/llvm/include/llvm/Analysis/FunctionPropertiesAnalysis.h @@ -69,6 +69,8 @@ using Result = FunctionPropertiesInfo; Result run(Function &F, FunctionAnalysisManager &FAM); + + static StringRef name() { return "func-properties"; } }; /// Printer pass for the FunctionPropertiesAnalysis results. @@ -80,6 +82,8 @@ explicit FunctionPropertiesPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/GlobalsModRef.h b/llvm/include/llvm/Analysis/GlobalsModRef.h --- a/llvm/include/llvm/Analysis/GlobalsModRef.h +++ b/llvm/include/llvm/Analysis/GlobalsModRef.h @@ -137,6 +137,7 @@ typedef GlobalsAAResult Result; GlobalsAAResult run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "globals-aa"; } }; /// Legacy wrapper pass to provide the GlobalsAAResult object. diff --git a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h --- a/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h +++ b/llvm/include/llvm/Analysis/IRSimilarityIdentifier.h @@ -768,6 +768,7 @@ typedef IRSimilarity::IRSimilarityIdentifier Result; Result run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "ir-similarity"; } private: friend AnalysisInfoMixin; @@ -782,6 +783,7 @@ public: explicit IRSimilarityAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-ir-similarity"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/IVUsers.h b/llvm/include/llvm/Analysis/IVUsers.h --- a/llvm/include/llvm/Analysis/IVUsers.h +++ b/llvm/include/llvm/Analysis/IVUsers.h @@ -194,6 +194,8 @@ IVUsers run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR); + + static StringRef name() { return "iv-users"; } }; } diff --git a/llvm/include/llvm/Analysis/InlineAdvisor.h b/llvm/include/llvm/Analysis/InlineAdvisor.h --- a/llvm/include/llvm/Analysis/InlineAdvisor.h +++ b/llvm/include/llvm/Analysis/InlineAdvisor.h @@ -240,6 +240,7 @@ }; Result run(Module &M, ModuleAnalysisManager &MAM) { return Result(M, MAM); } + static StringRef name() { return "inline-advisor"; } }; #ifdef LLVM_HAVE_TF_AOT diff --git a/llvm/include/llvm/Analysis/InlineCost.h b/llvm/include/llvm/Analysis/InlineCost.h --- a/llvm/include/llvm/Analysis/InlineCost.h +++ b/llvm/include/llvm/Analysis/InlineCost.h @@ -283,6 +283,8 @@ public: explicit InlineCostAnnotationPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + + static StringRef name() { return "print"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h b/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h --- a/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h +++ b/llvm/include/llvm/Analysis/InlineSizeEstimatorAnalysis.h @@ -27,6 +27,7 @@ using Result = Optional; Result run(const Function &F, FunctionAnalysisManager &FAM); static bool isEvaluatorRequested(); + static StringRef name() { return "inliner-size-estimator"; } private: std::unique_ptr Evaluator; @@ -40,6 +41,8 @@ explicit InlineSizeEstimatorAnalysisPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; } // namespace llvm #endif // LLVM_ANALYSIS_INLINESIZEESTIMATORANALYSIS_H diff --git a/llvm/include/llvm/Analysis/InstCount.h b/llvm/include/llvm/Analysis/InstCount.h --- a/llvm/include/llvm/Analysis/InstCount.h +++ b/llvm/include/llvm/Analysis/InstCount.h @@ -21,6 +21,7 @@ struct InstCountPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "instcount"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/LazyCallGraph.h b/llvm/include/llvm/Analysis/LazyCallGraph.h --- a/llvm/include/llvm/Analysis/LazyCallGraph.h +++ b/llvm/include/llvm/Analysis/LazyCallGraph.h @@ -1293,6 +1293,8 @@ }; return LazyCallGraph(M, GetTLI); } + + static StringRef name() { return "lcg"; } }; /// A pass which prints the call graph to a \c raw_ostream. @@ -1306,6 +1308,7 @@ explicit LazyCallGraphPrinterPass(raw_ostream &OS); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-lcg"; } }; /// A pass which prints the call graph as a DOT file to a \c raw_ostream. @@ -1319,6 +1322,7 @@ explicit LazyCallGraphDOTPrinterPass(raw_ostream &OS); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-lcg-dot"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/LazyValueInfo.h b/llvm/include/llvm/Analysis/LazyValueInfo.h --- a/llvm/include/llvm/Analysis/LazyValueInfo.h +++ b/llvm/include/llvm/Analysis/LazyValueInfo.h @@ -124,6 +124,7 @@ public: typedef LazyValueInfo Result; Result run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "lazy-value-info"; } private: static AnalysisKey Key; diff --git a/llvm/include/llvm/Analysis/Lint.h b/llvm/include/llvm/Analysis/Lint.h --- a/llvm/include/llvm/Analysis/Lint.h +++ b/llvm/include/llvm/Analysis/Lint.h @@ -41,6 +41,7 @@ class LintPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "lint"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h --- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h +++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h @@ -756,6 +756,8 @@ typedef LoopAccessInfo Result; Result run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR); + + static StringRef name() { return "access-info"; } }; inline Instruction *MemoryDepChecker::Dependence::getSource( diff --git a/llvm/include/llvm/Analysis/LoopCacheAnalysis.h b/llvm/include/llvm/Analysis/LoopCacheAnalysis.h --- a/llvm/include/llvm/Analysis/LoopCacheAnalysis.h +++ b/llvm/include/llvm/Analysis/LoopCacheAnalysis.h @@ -275,6 +275,8 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + + static StringRef name() { return "print"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/LoopInfo.h b/llvm/include/llvm/Analysis/LoopInfo.h --- a/llvm/include/llvm/Analysis/LoopInfo.h +++ b/llvm/include/llvm/Analysis/LoopInfo.h @@ -1229,6 +1229,8 @@ typedef LoopInfo Result; LoopInfo run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "loops"; } }; /// Printer pass for the \c LoopAnalysis results. @@ -1238,11 +1240,13 @@ public: explicit LoopPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print"; } }; /// Verifier pass for the \c LoopAnalysis results. struct LoopVerifierPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "verify"; } }; /// The legacy pass manager's analysis pass to compute loop information. diff --git a/llvm/include/llvm/Analysis/LoopNestAnalysis.h b/llvm/include/llvm/Analysis/LoopNestAnalysis.h --- a/llvm/include/llvm/Analysis/LoopNestAnalysis.h +++ b/llvm/include/llvm/Analysis/LoopNestAnalysis.h @@ -173,6 +173,7 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "print"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/MemDerefPrinter.h b/llvm/include/llvm/Analysis/MemDerefPrinter.h --- a/llvm/include/llvm/Analysis/MemDerefPrinter.h +++ b/llvm/include/llvm/Analysis/MemDerefPrinter.h @@ -18,6 +18,7 @@ public: MemDerefPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print-memderefs"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h --- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h +++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h @@ -509,6 +509,8 @@ MemoryDependenceAnalysis(unsigned DefaultBlockScanLimit) : DefaultBlockScanLimit(DefaultBlockScanLimit) { } MemoryDependenceResults run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "memdep"; } }; /// A wrapper analysis pass for the legacy pass manager that exposes a \c diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h --- a/llvm/include/llvm/Analysis/MemorySSA.h +++ b/llvm/include/llvm/Analysis/MemorySSA.h @@ -939,6 +939,8 @@ }; Result run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "memoryssa"; } }; /// Printer pass for \c MemorySSA. @@ -949,11 +951,14 @@ explicit MemorySSAPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// Verifier pass for \c MemorySSA. struct MemorySSAVerifierPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "verify"; } }; /// Legacy analysis pass which computes \c MemorySSA. diff --git a/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h b/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h --- a/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h +++ b/llvm/include/llvm/Analysis/ModuleDebugInfoPrinter.h @@ -23,6 +23,7 @@ public: explicit ModuleDebugInfoPrinterPass(raw_ostream &OS); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h --- a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h +++ b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h @@ -51,6 +51,7 @@ using Result = ModuleSummaryIndex; Result run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "module-summary"; } }; /// Legacy wrapper pass to provide the ModuleSummaryIndex object. diff --git a/llvm/include/llvm/Analysis/MustExecute.h b/llvm/include/llvm/Analysis/MustExecute.h --- a/llvm/include/llvm/Analysis/MustExecute.h +++ b/llvm/include/llvm/Analysis/MustExecute.h @@ -549,6 +549,7 @@ public: MustExecutePrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print-mustexecute"; } }; class MustBeExecutedContextPrinterPass @@ -558,6 +559,7 @@ public: MustBeExecutedContextPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-must-be-executed-contexts"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h --- a/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/ObjCARCAliasAnalysis.h @@ -74,6 +74,8 @@ typedef ObjCARCAAResult Result; ObjCARCAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "objc-arc-aa"; } }; /// Legacy wrapper pass to provide the ObjCARCAAResult object. diff --git a/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h b/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h --- a/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h +++ b/llvm/include/llvm/Analysis/OptimizationRemarkEmitter.h @@ -164,6 +164,8 @@ /// Run the analysis pass over a function and produce BFI. Result run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "opt-remark-emit"; } }; } #endif // LLVM_ANALYSIS_OPTIMIZATIONREMARKEMITTER_H diff --git a/llvm/include/llvm/Analysis/PhiValues.h b/llvm/include/llvm/Analysis/PhiValues.h --- a/llvm/include/llvm/Analysis/PhiValues.h +++ b/llvm/include/llvm/Analysis/PhiValues.h @@ -120,6 +120,7 @@ public: using Result = PhiValues; PhiValues run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "phi-values"; } }; /// A pass for printing the PhiValues for a function. @@ -133,6 +134,7 @@ public: explicit PhiValuesPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print"; } }; /// Wrapper pass for the legacy pass manager diff --git a/llvm/include/llvm/Analysis/PostDominators.h b/llvm/include/llvm/Analysis/PostDominators.h --- a/llvm/include/llvm/Analysis/PostDominators.h +++ b/llvm/include/llvm/Analysis/PostDominators.h @@ -57,6 +57,8 @@ /// Run the analysis pass over a function and produce a post dominator /// tree. PostDominatorTree run(Function &F, FunctionAnalysisManager &); + + static StringRef name() { return "postdomtree"; } }; /// Printer pass for the \c PostDominatorTree. @@ -68,6 +70,8 @@ explicit PostDominatorTreePrinterPass(raw_ostream &OS); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; struct PostDominatorTreeWrapperPass : public FunctionPass { diff --git a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h --- a/llvm/include/llvm/Analysis/ProfileSummaryInfo.h +++ b/llvm/include/llvm/Analysis/ProfileSummaryInfo.h @@ -207,6 +207,7 @@ typedef ProfileSummaryInfo Result; Result run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "profile-summary"; } private: friend AnalysisInfoMixin; @@ -221,6 +222,7 @@ public: explicit ProfileSummaryPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-profile-summary"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/RegionInfo.h b/llvm/include/llvm/Analysis/RegionInfo.h --- a/llvm/include/llvm/Analysis/RegionInfo.h +++ b/llvm/include/llvm/Analysis/RegionInfo.h @@ -973,6 +973,8 @@ using Result = RegionInfo; RegionInfo run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "regions"; } }; /// Printer pass for the \c RegionInfo. @@ -983,11 +985,14 @@ explicit RegionInfoPrinterPass(raw_ostream &OS); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// Verifier pass for the \c RegionInfo. struct RegionInfoVerifierPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "verify"; } }; template <> diff --git a/llvm/include/llvm/Analysis/ScalarEvolution.h b/llvm/include/llvm/Analysis/ScalarEvolution.h --- a/llvm/include/llvm/Analysis/ScalarEvolution.h +++ b/llvm/include/llvm/Analysis/ScalarEvolution.h @@ -2065,6 +2065,8 @@ using Result = ScalarEvolution; ScalarEvolution run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "scalar-evolution"; } }; /// Verifier pass for the \c ScalarEvolutionAnalysis results. @@ -2072,6 +2074,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "verify"; } }; /// Printer pass for the \c ScalarEvolutionAnalysis results. @@ -2083,6 +2086,8 @@ explicit ScalarEvolutionPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; class ScalarEvolutionWrapperPass : public FunctionPass { diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h --- a/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/ScalarEvolutionAliasAnalysis.h @@ -46,6 +46,8 @@ typedef SCEVAAResult Result; SCEVAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "scev-aa"; } }; /// Legacy wrapper pass to provide the SCEVAAResult object. diff --git a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h --- a/llvm/include/llvm/Analysis/ScopedNoAliasAA.h +++ b/llvm/include/llvm/Analysis/ScopedNoAliasAA.h @@ -59,6 +59,8 @@ using Result = ScopedNoAliasAAResult; ScopedNoAliasAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "scoped-noalias-aa"; } }; /// Legacy wrapper pass to provide the ScopedNoAliasAAResult object. diff --git a/llvm/include/llvm/Analysis/StackLifetime.h b/llvm/include/llvm/Analysis/StackLifetime.h --- a/llvm/include/llvm/Analysis/StackLifetime.h +++ b/llvm/include/llvm/Analysis/StackLifetime.h @@ -191,6 +191,7 @@ StackLifetimePrinterPass(raw_ostream &OS, StackLifetime::LivenessType Type) : Type(Type), OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h --- a/llvm/include/llvm/Analysis/StackSafetyAnalysis.h +++ b/llvm/include/llvm/Analysis/StackSafetyAnalysis.h @@ -88,6 +88,7 @@ public: using Result = StackSafetyInfo; StackSafetyInfo run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "stack-safety-local"; } }; /// Printer pass for the \c StackSafetyAnalysis results. @@ -97,6 +98,7 @@ public: explicit StackSafetyPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print"; } }; /// StackSafetyInfo wrapper for the legacy pass manager @@ -125,6 +127,7 @@ public: using Result = StackSafetyGlobalInfo; Result run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "stack-safety"; } }; /// Printer pass for the \c StackSafetyGlobalAnalysis results. @@ -135,6 +138,7 @@ public: explicit StackSafetyGlobalPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "print-stack-safety"; } }; /// This pass performs the global (interprocedural) stack safety analysis diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h @@ -431,6 +431,8 @@ TargetLibraryInfo run(const Function &F, FunctionAnalysisManager &); + static StringRef name() { return "targetlibinfo"; } + private: friend AnalysisInfoMixin; static AnalysisKey Key; diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h --- a/llvm/include/llvm/Analysis/TargetTransformInfo.h +++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h @@ -2254,6 +2254,8 @@ Result run(const Function &F, FunctionAnalysisManager &); + static StringRef name() { return "target-ir"; } + private: friend AnalysisInfoMixin; static AnalysisKey Key; diff --git a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h --- a/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h +++ b/llvm/include/llvm/Analysis/TypeBasedAliasAnalysis.h @@ -65,6 +65,8 @@ using Result = TypeBasedAAResult; TypeBasedAAResult run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "tbaa"; } }; /// Legacy wrapper pass to provide the TypeBasedAAResult object. diff --git a/llvm/include/llvm/Bitcode/BitcodeWriterPass.h b/llvm/include/llvm/Bitcode/BitcodeWriterPass.h --- a/llvm/include/llvm/Bitcode/BitcodeWriterPass.h +++ b/llvm/include/llvm/Bitcode/BitcodeWriterPass.h @@ -71,6 +71,8 @@ /// Run the bitcode writer pass, and output the module to the selected /// output stream. PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + + static StringRef name() { return "bitcode-writer"; } }; } diff --git a/llvm/include/llvm/IR/Dominators.h b/llvm/include/llvm/IR/Dominators.h --- a/llvm/include/llvm/IR/Dominators.h +++ b/llvm/include/llvm/IR/Dominators.h @@ -256,6 +256,8 @@ /// Run the analysis pass over a function and produce a dominator tree. DominatorTree run(Function &F, FunctionAnalysisManager &); + + static StringRef name() { return "domtree"; } }; /// Printer pass for the \c DominatorTree. @@ -267,11 +269,14 @@ explicit DominatorTreePrinterPass(raw_ostream &OS); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "print"; } }; /// Verifier pass for the \c DominatorTree. struct DominatorTreeVerifierPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "verify"; } }; /// Legacy analysis pass which computes a \c DominatorTree. diff --git a/llvm/include/llvm/IR/IRPrintingPasses.h b/llvm/include/llvm/IR/IRPrintingPasses.h --- a/llvm/include/llvm/IR/IRPrintingPasses.h +++ b/llvm/include/llvm/IR/IRPrintingPasses.h @@ -61,6 +61,7 @@ PreservedAnalyses run(Module &M, AnalysisManager &); static bool isRequired() { return true; } + static StringRef name() { return "print"; } }; /// Pass for printing a Function as LLVM's text IR assembly. @@ -77,6 +78,7 @@ PreservedAnalyses run(Function &F, AnalysisManager &); static bool isRequired() { return true; } + static StringRef name() { return "print"; } }; } // namespace llvm diff --git a/llvm/include/llvm/IR/PassInstrumentation.h b/llvm/include/llvm/IR/PassInstrumentation.h --- a/llvm/include/llvm/IR/PassInstrumentation.h +++ b/llvm/include/llvm/IR/PassInstrumentation.h @@ -123,11 +123,6 @@ AfterAnalysisCallbacks.emplace_back(std::move(C)); } - /// Add a class name to pass name mapping for use by pass instrumentation. - void addClassToPassName(StringRef ClassName, StringRef PassName); - /// Get the pass name for a given pass class name. - StringRef getPassNameForClassName(StringRef ClassName); - private: friend class PassInstrumentation; @@ -152,8 +147,6 @@ /// These are run on analyses that have been run. SmallVector, 4> AfterAnalysisCallbacks; - - StringMap ClassToPassName; }; /// This class provides instrumentation entry points for the Pass Manager, diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -373,14 +373,14 @@ /// This provides some boilerplate for types that are passes. template struct PassInfoMixin { /// Gets the name of the pass we are mixed into. - static StringRef name() { - static_assert(std::is_base_of::value, - "Must pass the derived type as the template argument!"); - StringRef Name = getTypeName(); - if (Name.startswith("llvm::")) - Name = Name.drop_front(strlen("llvm::")); - return Name; - } + // static StringRef name() { + // static_assert(std::is_base_of::value, + // "Must pass the derived type as the template argument!"); + // StringRef Name = getTypeName(); + // if (Name.startswith("llvm::")) + // Name = Name.drop_front(strlen("llvm::")); + // return Name; + // } }; /// A CRTP mix-in that provides informational APIs needed for analysis passes. @@ -466,6 +466,8 @@ class PassManager : public PassInfoMixin< PassManager> { public: + static StringRef name() { return "pass-manager"; } + /// Construct a pass manager. /// /// If \p DebugLogging is true, we'll log our progress to llvm::dbgs(). @@ -619,6 +621,7 @@ Result run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) { return PassInstrumentation(Callbacks); } + static StringRef name() { return "pass-instrumentation"; } }; /// A container for analyses that lazily runs them and caches their @@ -970,6 +973,8 @@ : public AnalysisInfoMixin< InnerAnalysisManagerProxy> { public: + static StringRef name() { return "inner-analysis-manager-proxy"; } + class Result { public: explicit Result(AnalysisManagerT &InnerAM) : InnerAM(&InnerAM) {} @@ -1095,6 +1100,8 @@ : public AnalysisInfoMixin< OuterAnalysisManagerProxy> { public: + static StringRef name() { return "outer-analysis-manager-proxy"; } + /// Result proxy object for \c OuterAnalysisManagerProxy. class Result { public: @@ -1240,6 +1247,7 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "module-to-function-adaptor"; } private: std::unique_ptr Pass; @@ -1287,6 +1295,7 @@ return PreservedAnalyses::all(); } static bool isRequired() { return true; } + static StringRef name() { return "require-analysis"; } }; /// A no-op pass template which simply forces a specific analysis result @@ -1306,6 +1315,7 @@ PA.abandon(); return PA; } + static StringRef name() { return "invalidate"; } }; /// A utility pass that does nothing, but preserves no analyses. @@ -1318,6 +1328,7 @@ PreservedAnalyses run(IRUnitT &, AnalysisManagerT &, ExtraArgTs &&...) { return PreservedAnalyses::none(); } + static StringRef name() { return "invalidate"; } }; /// A utility pass template that simply runs another pass multiple times. @@ -1353,6 +1364,7 @@ } return PA; } + static StringRef name() { return "repeat"; } private: int Count; diff --git a/llvm/include/llvm/IR/SafepointIRVerifier.h b/llvm/include/llvm/IR/SafepointIRVerifier.h --- a/llvm/include/llvm/IR/SafepointIRVerifier.h +++ b/llvm/include/llvm/IR/SafepointIRVerifier.h @@ -40,6 +40,8 @@ explicit SafepointIRVerifierPass() {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "verify"; } }; } diff --git a/llvm/include/llvm/IR/Verifier.h b/llvm/include/llvm/IR/Verifier.h --- a/llvm/include/llvm/IR/Verifier.h +++ b/llvm/include/llvm/IR/Verifier.h @@ -117,6 +117,7 @@ Result run(Module &M, ModuleAnalysisManager &); Result run(Function &F, FunctionAnalysisManager &); static bool isRequired() { return true; } + static StringRef name() { return "verify"; } }; /// Check a module for errors, but report debug info errors separately. @@ -143,6 +144,7 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "verify"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h b/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h --- a/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h +++ b/llvm/include/llvm/Transforms/AggressiveInstCombine/AggressiveInstCombine.h @@ -26,6 +26,7 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "aggressive-instcombine"; } }; //===----------------------------------------------------------------------===// diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h b/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h --- a/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h +++ b/llvm/include/llvm/Transforms/Coroutines/CoroCleanup.h @@ -23,6 +23,7 @@ struct CoroCleanupPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "coro-cleanup"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h b/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h --- a/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h +++ b/llvm/include/llvm/Transforms/Coroutines/CoroEarly.h @@ -26,6 +26,7 @@ struct CoroEarlyPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "coro-early"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroElide.h b/llvm/include/llvm/Transforms/Coroutines/CoroElide.h --- a/llvm/include/llvm/Transforms/Coroutines/CoroElide.h +++ b/llvm/include/llvm/Transforms/Coroutines/CoroElide.h @@ -25,6 +25,7 @@ struct CoroElidePass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "coro-elide"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h --- a/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h +++ b/llvm/include/llvm/Transforms/Coroutines/CoroSplit.h @@ -27,6 +27,7 @@ PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); static bool isRequired() { return true; } + static StringRef name() { return "coro-split"; } bool ReuseFrameSlot; }; diff --git a/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h b/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h --- a/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h +++ b/llvm/include/llvm/Transforms/IPO/AlwaysInliner.h @@ -35,6 +35,7 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &); static bool isRequired() { return true; } + static StringRef name() { return "always-inline"; } }; /// Create a legacy pass manager instance of a pass to inline and remove diff --git a/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h b/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h --- a/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h +++ b/llvm/include/llvm/Transforms/IPO/Annotation2Metadata.h @@ -23,6 +23,7 @@ /// Pass to convert @llvm.global.annotations to !annotation metadata. struct Annotation2MetadataPass : public PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "annotation2metadata"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h --- a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h +++ b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h @@ -40,6 +40,8 @@ PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); + + static StringRef name() { return "argpromotion"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -2377,10 +2377,12 @@ struct AttributorPass : public PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "attributor"; } }; struct AttributorCGSCCPass : public PassInfoMixin { PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); + static StringRef name() { return "attributor-cgscc"; } }; Pass *createAttributorLegacyPass(); diff --git a/llvm/include/llvm/Transforms/IPO/BlockExtractor.h b/llvm/include/llvm/Transforms/IPO/BlockExtractor.h --- a/llvm/include/llvm/Transforms/IPO/BlockExtractor.h +++ b/llvm/include/llvm/Transforms/IPO/BlockExtractor.h @@ -19,6 +19,7 @@ namespace llvm { struct BlockExtractorPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "extract-blocks"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h b/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h --- a/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h +++ b/llvm/include/llvm/Transforms/IPO/CalledValuePropagation.h @@ -27,6 +27,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "called-value-propagation"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/ConstantMerge.h b/llvm/include/llvm/Transforms/IPO/ConstantMerge.h --- a/llvm/include/llvm/Transforms/IPO/ConstantMerge.h +++ b/llvm/include/llvm/Transforms/IPO/ConstantMerge.h @@ -29,6 +29,7 @@ class ConstantMergePass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "constmerge"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h b/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h --- a/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h +++ b/llvm/include/llvm/Transforms/IPO/CrossDSOCFI.h @@ -20,6 +20,7 @@ class CrossDSOCFIPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "cross-dso-cfi"; } }; } #endif // LLVM_TRANSFORMS_IPO_CROSSDSOCFI_H diff --git a/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h b/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h --- a/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h +++ b/llvm/include/llvm/Transforms/IPO/DeadArgumentElimination.h @@ -121,6 +121,8 @@ /// (used only by bugpoint). bool ShouldHackArguments = false; + static StringRef name() { return "deadargelim"; } + private: Liveness MarkIfNotLive(RetOrArg Use, UseVector &MaybeLiveUses); Liveness SurveyUse(const Use *U, UseVector &MaybeLiveUses, diff --git a/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h b/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h --- a/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h +++ b/llvm/include/llvm/Transforms/IPO/ElimAvailExtern.h @@ -25,6 +25,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "elim-avail-extern"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h --- a/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h +++ b/llvm/include/llvm/Transforms/IPO/ForceFunctionAttrs.h @@ -21,6 +21,7 @@ /// a debugging tool. struct ForceFunctionAttrsPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "forceattrs"; } }; /// Create a legacy pass manager instance of a pass to force function attrs. diff --git a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h --- a/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h +++ b/llvm/include/llvm/Transforms/IPO/FunctionAttrs.h @@ -50,6 +50,7 @@ struct PostOrderFunctionAttrsPass : PassInfoMixin { PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); + static StringRef name() { return "function-attrs"; } }; /// Create a legacy pass manager instance of a pass to compute function attrs @@ -70,6 +71,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "rpo-function-attrs"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/FunctionImport.h b/llvm/include/llvm/Transforms/IPO/FunctionImport.h --- a/llvm/include/llvm/Transforms/IPO/FunctionImport.h +++ b/llvm/include/llvm/Transforms/IPO/FunctionImport.h @@ -129,6 +129,7 @@ class FunctionImportPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "function-import"; } }; /// Compute all the imports and exports for every module in the Index. diff --git a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h --- a/llvm/include/llvm/Transforms/IPO/GlobalDCE.h +++ b/llvm/include/llvm/Transforms/IPO/GlobalDCE.h @@ -29,6 +29,7 @@ class GlobalDCEPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "globaldce"; } private: SmallPtrSet AliveGlobals; diff --git a/llvm/include/llvm/Transforms/IPO/GlobalOpt.h b/llvm/include/llvm/Transforms/IPO/GlobalOpt.h --- a/llvm/include/llvm/Transforms/IPO/GlobalOpt.h +++ b/llvm/include/llvm/Transforms/IPO/GlobalOpt.h @@ -25,6 +25,7 @@ class GlobalOptPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "globalopt"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/GlobalSplit.h b/llvm/include/llvm/Transforms/IPO/GlobalSplit.h --- a/llvm/include/llvm/Transforms/IPO/GlobalSplit.h +++ b/llvm/include/llvm/Transforms/IPO/GlobalSplit.h @@ -26,6 +26,7 @@ class GlobalSplitPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "globalsplit"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h b/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h --- a/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h +++ b/llvm/include/llvm/Transforms/IPO/HotColdSplitting.h @@ -61,6 +61,7 @@ class HotColdSplittingPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "hotcoldsplit"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/IROutliner.h b/llvm/include/llvm/Transforms/IPO/IROutliner.h --- a/llvm/include/llvm/Transforms/IPO/IROutliner.h +++ b/llvm/include/llvm/Transforms/IPO/IROutliner.h @@ -351,6 +351,7 @@ class IROutlinerPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "iroutliner"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h --- a/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h +++ b/llvm/include/llvm/Transforms/IPO/InferFunctionAttrs.h @@ -24,6 +24,7 @@ /// function declarations in a module. struct InferFunctionAttrsPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "inferattrs"; } }; /// Create a legacy pass manager instance of a pass to infer function diff --git a/llvm/include/llvm/Transforms/IPO/Inliner.h b/llvm/include/llvm/Transforms/IPO/Inliner.h --- a/llvm/include/llvm/Transforms/IPO/Inliner.h +++ b/llvm/include/llvm/Transforms/IPO/Inliner.h @@ -103,6 +103,8 @@ PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); + static StringRef name() { return "inline"; } + private: InlineAdvisor &getAdvisor(const ModuleAnalysisManagerCGSCCProxy::Result &MAM, FunctionAnalysisManager &FAM, Module &M); @@ -136,6 +138,8 @@ MPM.addPass(RequireAnalysisPass()); } + static StringRef name() { return "inliner-wrapper"; } + private: const InlineParams Params; const InliningAdvisorMode Mode; diff --git a/llvm/include/llvm/Transforms/IPO/Internalize.h b/llvm/include/llvm/Transforms/IPO/Internalize.h --- a/llvm/include/llvm/Transforms/IPO/Internalize.h +++ b/llvm/include/llvm/Transforms/IPO/Internalize.h @@ -63,6 +63,8 @@ bool internalizeModule(Module &TheModule, CallGraph *CG = nullptr); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + + static StringRef name() { return "internalize"; } }; /// Helper function to internalize functions and variables in a Module. diff --git a/llvm/include/llvm/Transforms/IPO/LoopExtractor.h b/llvm/include/llvm/Transforms/IPO/LoopExtractor.h --- a/llvm/include/llvm/Transforms/IPO/LoopExtractor.h +++ b/llvm/include/llvm/Transforms/IPO/LoopExtractor.h @@ -23,6 +23,7 @@ struct LoopExtractorPass : public PassInfoMixin { LoopExtractorPass(unsigned NumLoops = ~0) : NumLoops(NumLoops) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "loop-extract"; } private: unsigned NumLoops; diff --git a/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h b/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h --- a/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h +++ b/llvm/include/llvm/Transforms/IPO/LowerTypeTests.h @@ -212,6 +212,7 @@ : ExportSummary(ExportSummary), ImportSummary(ImportSummary), DropTypeTests(DropTypeTests) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "lowertypetests"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/MergeFunctions.h b/llvm/include/llvm/Transforms/IPO/MergeFunctions.h --- a/llvm/include/llvm/Transforms/IPO/MergeFunctions.h +++ b/llvm/include/llvm/Transforms/IPO/MergeFunctions.h @@ -25,6 +25,7 @@ class MergeFunctionsPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "mergefunc"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h b/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h --- a/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h +++ b/llvm/include/llvm/Transforms/IPO/OpenMPOpt.h @@ -69,6 +69,7 @@ public: PreservedAnalyses run(LazyCallGraph::SCC &C, CGSCCAnalysisManager &AM, LazyCallGraph &CG, CGSCCUpdateResult &UR); + static StringRef name() { return "openmpopt"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/PartialInlining.h b/llvm/include/llvm/Transforms/IPO/PartialInlining.h --- a/llvm/include/llvm/Transforms/IPO/PartialInlining.h +++ b/llvm/include/llvm/Transforms/IPO/PartialInlining.h @@ -24,6 +24,7 @@ class PartialInlinerPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "partial-inliner"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/SCCP.h b/llvm/include/llvm/Transforms/IPO/SCCP.h --- a/llvm/include/llvm/Transforms/IPO/SCCP.h +++ b/llvm/include/llvm/Transforms/IPO/SCCP.h @@ -30,6 +30,7 @@ class IPSCCPPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "ipsccp"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfile.h b/llvm/include/llvm/Transforms/IPO/SampleProfile.h --- a/llvm/include/llvm/Transforms/IPO/SampleProfile.h +++ b/llvm/include/llvm/Transforms/IPO/SampleProfile.h @@ -32,6 +32,8 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "sample-profile"; } + private: std::string ProfileFileName; std::string ProfileRemappingFileName; diff --git a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h --- a/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h +++ b/llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h @@ -133,6 +133,7 @@ public: SampleProfileProbePass(TargetMachine *TM) : TM(TM) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "pseudo-probe"; } }; class PseudoProbeUpdatePass : public PassInfoMixin { @@ -141,6 +142,7 @@ public: PseudoProbeUpdatePass() {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "pseudo-probe-update"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h b/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h --- a/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h +++ b/llvm/include/llvm/Transforms/IPO/StripDeadPrototypes.h @@ -24,6 +24,7 @@ /// Pass to remove unused function declarations. struct StripDeadPrototypesPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "strip-dead-prototype"; } }; } diff --git a/llvm/include/llvm/Transforms/IPO/StripSymbols.h b/llvm/include/llvm/Transforms/IPO/StripSymbols.h --- a/llvm/include/llvm/Transforms/IPO/StripSymbols.h +++ b/llvm/include/llvm/Transforms/IPO/StripSymbols.h @@ -28,18 +28,22 @@ struct StripSymbolsPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "strip"; } }; struct StripNonDebugSymbolsPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "strip-nondebug"; } }; struct StripDebugDeclarePass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "strip-debug-declare"; } }; struct StripDeadDebugInfoPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "strip-dead-debug-info"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h b/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h --- a/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h +++ b/llvm/include/llvm/Transforms/IPO/SyntheticCountsPropagation.h @@ -18,6 +18,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM); + static StringRef name() { return "synthetic-counts-propagation"; } }; } // namespace llvm #endif diff --git a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h --- a/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h +++ b/llvm/include/llvm/Transforms/IPO/ThinLTOBitcodeWriter.h @@ -33,6 +33,8 @@ : OS(OS), ThinLinkOS(ThinLinkOS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + + static StringRef name() { return "thinlto-bitcode-writer"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h --- a/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h +++ b/llvm/include/llvm/Transforms/IPO/WholeProgramDevirt.h @@ -232,6 +232,7 @@ assert(!(ExportSummary && ImportSummary)); } PreservedAnalyses run(Module &M, ModuleAnalysisManager &); + static StringRef name() { return "wholeprogramdevirt"; } }; struct VTableSlotSummary { diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h --- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h +++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h @@ -27,7 +27,7 @@ const unsigned MaxIterations; public: - static StringRef name() { return "InstCombinePass"; } + static StringRef name() { return "instcombine"; } explicit InstCombinePass(); explicit InstCombinePass(unsigned MaxIterations); diff --git a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h --- a/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h @@ -84,6 +84,7 @@ using Result = GlobalsMetadata; Result run(Module &, ModuleAnalysisManager &); + static StringRef name() { return "asan-globals-md"; } private: friend AnalysisInfoMixin; @@ -104,6 +105,7 @@ bool UseAfterScope = false); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "asan"; } private: bool CompileKernel; @@ -125,6 +127,7 @@ AsanDtorKind DestructorKind = AsanDtorKind::Global); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "asan-module"; } private: bool CompileKernel; diff --git a/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h b/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h --- a/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h +++ b/llvm/include/llvm/Transforms/Instrumentation/BoundsChecking.h @@ -18,6 +18,7 @@ struct BoundsCheckingPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "bounds-checking"; } }; diff --git a/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h b/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h --- a/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h +++ b/llvm/include/llvm/Transforms/Instrumentation/CGProfile.h @@ -19,6 +19,7 @@ class CGProfilePass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "cg-profile"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h b/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h --- a/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h +++ b/llvm/include/llvm/Transforms/Instrumentation/ControlHeightReduction.h @@ -24,6 +24,7 @@ public: ControlHeightReductionPass(); PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "chr"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h --- a/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/DataFlowSanitizer.h @@ -25,6 +25,7 @@ : ABIListFiles(ABIListFiles) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "dfsan"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h --- a/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h +++ b/llvm/include/llvm/Transforms/Instrumentation/GCOVProfiler.h @@ -21,6 +21,7 @@ public: GCOVProfilerPass(const GCOVOptions &Options = GCOVOptions::getDefault()) : GCOVOpts(Options) { } PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "insert-gcov-profiling"; } private: GCOVOptions GCOVOpts; diff --git a/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h --- a/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/HWAddressSanitizer.h @@ -28,6 +28,7 @@ bool Recover = false); PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM); static bool isRequired() { return true; } + static StringRef name() { return "hwasan"; } private: bool CompileKernel; diff --git a/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h b/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h --- a/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h +++ b/llvm/include/llvm/Transforms/Instrumentation/InstrOrderFile.h @@ -21,6 +21,7 @@ class InstrOrderFilePass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "instrorderfile"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h b/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h --- a/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h +++ b/llvm/include/llvm/Transforms/Instrumentation/InstrProfiling.h @@ -41,6 +41,7 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); bool run(Module &M, std::function GetTLI); + static StringRef name() { return "instrprof"; } private: InstrProfOptions Options; diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h --- a/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h +++ b/llvm/include/llvm/Transforms/Instrumentation/MemProfiler.h @@ -31,6 +31,7 @@ explicit MemProfilerPass(); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "memprof"; } }; /// Public interface to the memory profiler module pass for instrumenting code @@ -40,6 +41,7 @@ explicit ModuleMemProfilerPass(); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "memprof-module"; } }; // Insert MemProfiler instrumentation diff --git a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h --- a/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h @@ -42,6 +42,7 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "msan"; } private: MemorySanitizerOptions Options; diff --git a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h --- a/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h +++ b/llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h @@ -38,6 +38,7 @@ PGOInstrumentationGenCreateVar(std::string CSInstrName = "") : CSInstrName(CSInstrName) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "pgo-instr-gen-create-var"; } private: std::string CSInstrName; @@ -48,6 +49,7 @@ public: PGOInstrumentationGen(bool IsCS = false) : IsCS(IsCS) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "pgo-instr-gen"; } private: // If this is a context sensitive instrumentation. @@ -61,6 +63,7 @@ std::string RemappingFilename = "", bool IsCS = false); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "pgo-instr-use"; } private: std::string ProfileFileName; @@ -76,6 +79,7 @@ : InLTO(IsInLTO), SamplePGO(SamplePGO) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "pgo-icall-prom"; } private: bool InLTO; @@ -88,6 +92,8 @@ PGOMemOPSizeOpt() = default; PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "pgo-memop-opt"; } }; void setProfMetadata(Module *M, Instruction *TI, ArrayRef EdgeCounts, diff --git a/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h b/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h --- a/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h +++ b/llvm/include/llvm/Transforms/Instrumentation/PoisonChecking.h @@ -16,6 +16,7 @@ struct PoisonCheckingPass : public PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "poison-checking"; } }; } diff --git a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h --- a/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h +++ b/llvm/include/llvm/Transforms/Instrumentation/SanitizerCoverage.h @@ -47,6 +47,7 @@ } PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "sancov-module"; } private: SanitizerCoverageOptions Options; diff --git a/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h b/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h --- a/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h +++ b/llvm/include/llvm/Transforms/Instrumentation/ThreadSanitizer.h @@ -29,6 +29,7 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "tsan"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/ObjCARC.h b/llvm/include/llvm/Transforms/ObjCARC.h --- a/llvm/include/llvm/Transforms/ObjCARC.h +++ b/llvm/include/llvm/Transforms/ObjCARC.h @@ -46,18 +46,22 @@ struct ObjCARCOptPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "objc-arc"; } }; struct ObjCARCContractPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "objc-arc-contract"; } }; struct ObjCARCAPElimPass : public PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "objc-arc-apelim"; } }; struct ObjCARCExpandPass : public PassInfoMixin { PreservedAnalyses run(Function &M, FunctionAnalysisManager &AM); + static StringRef name() { return "objc-arc-expand"; } }; } // End llvm namespace diff --git a/llvm/include/llvm/Transforms/Scalar/ADCE.h b/llvm/include/llvm/Transforms/Scalar/ADCE.h --- a/llvm/include/llvm/Transforms/Scalar/ADCE.h +++ b/llvm/include/llvm/Transforms/Scalar/ADCE.h @@ -30,6 +30,7 @@ /// loop computations. struct ADCEPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "adce"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h b/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h --- a/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h +++ b/llvm/include/llvm/Transforms/Scalar/AlignmentFromAssumptions.h @@ -40,6 +40,8 @@ bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr, const SCEV *&AlignSCEV, const SCEV *&OffSCEV); bool processAssumption(CallInst *I, unsigned Idx); + + static StringRef name() { return "alignment-from-assumptions"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h b/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h --- a/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h +++ b/llvm/include/llvm/Transforms/Scalar/AnnotationRemarks.h @@ -20,6 +20,7 @@ namespace llvm { struct AnnotationRemarksPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "annotation-remarks"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/BDCE.h b/llvm/include/llvm/Transforms/Scalar/BDCE.h --- a/llvm/include/llvm/Transforms/Scalar/BDCE.h +++ b/llvm/include/llvm/Transforms/Scalar/BDCE.h @@ -24,6 +24,7 @@ // The Bit-Tracking Dead Code Elimination pass. struct BDCEPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "bdce"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h b/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h --- a/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h +++ b/llvm/include/llvm/Transforms/Scalar/CallSiteSplitting.h @@ -17,6 +17,7 @@ struct CallSiteSplittingPass : PassInfoMixin { /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "callsite-splitting"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h b/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h --- a/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h +++ b/llvm/include/llvm/Transforms/Scalar/ConstantHoisting.h @@ -125,6 +125,8 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "consthoist"; } + // Glue for old PM. bool runImpl(Function &F, TargetTransformInfo &TTI, DominatorTree &DT, BlockFrequencyInfo *BFI, BasicBlock &Entry, diff --git a/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h b/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h --- a/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h +++ b/llvm/include/llvm/Transforms/Scalar/ConstraintElimination.h @@ -17,6 +17,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "constraint-elimination"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h b/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h --- a/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h +++ b/llvm/include/llvm/Transforms/Scalar/CorrelatedValuePropagation.h @@ -18,6 +18,7 @@ struct CorrelatedValuePropagationPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "correlated-propagation"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/DCE.h b/llvm/include/llvm/Transforms/Scalar/DCE.h --- a/llvm/include/llvm/Transforms/Scalar/DCE.h +++ b/llvm/include/llvm/Transforms/Scalar/DCE.h @@ -22,12 +22,14 @@ class DCEPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "dce"; } }; class RedundantDbgInstEliminationPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "redundant-dbg-inst-elim"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h b/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h --- a/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h +++ b/llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h @@ -28,6 +28,7 @@ class DSEPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "dse"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h b/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h --- a/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h +++ b/llvm/include/llvm/Transforms/Scalar/DivRemPairs.h @@ -23,6 +23,7 @@ struct DivRemPairsPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "div-rem-pairs"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h --- a/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h +++ b/llvm/include/llvm/Transforms/Scalar/EarlyCSE.h @@ -34,6 +34,8 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); bool UseMemorySSA; + + static StringRef name() { return "early-cse"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/Float2Int.h b/llvm/include/llvm/Transforms/Scalar/Float2Int.h --- a/llvm/include/llvm/Transforms/Scalar/Float2Int.h +++ b/llvm/include/llvm/Transforms/Scalar/Float2Int.h @@ -27,6 +27,8 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "float2int"; } + // Glue for old PM. bool runImpl(Function &F, const DominatorTree &DT); diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h b/llvm/include/llvm/Transforms/Scalar/GVN.h --- a/llvm/include/llvm/Transforms/Scalar/GVN.h +++ b/llvm/include/llvm/Transforms/Scalar/GVN.h @@ -116,6 +116,8 @@ GVNOptions Options; public: + static StringRef name() { return "gvn"; } + struct Expression; GVN(GVNOptions Options = {}) : Options(Options) {} @@ -359,6 +361,7 @@ struct GVNHoistPass : PassInfoMixin { /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "gvn-hoist"; } }; /// Uses an "inverted" value numbering to decide the similarity of @@ -366,6 +369,7 @@ struct GVNSinkPass : PassInfoMixin { /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "gvn-sink"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/GuardWidening.h b/llvm/include/llvm/Transforms/Scalar/GuardWidening.h --- a/llvm/include/llvm/Transforms/Scalar/GuardWidening.h +++ b/llvm/include/llvm/Transforms/Scalar/GuardWidening.h @@ -27,6 +27,7 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "guard-widening"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h b/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h --- a/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h +++ b/llvm/include/llvm/Transforms/Scalar/IVUsersPrinter.h @@ -23,6 +23,7 @@ explicit IVUsersPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "print"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h b/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h --- a/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h +++ b/llvm/include/llvm/Transforms/Scalar/IndVarSimplify.h @@ -30,6 +30,7 @@ IndVarSimplifyPass(bool WidenIndVars = true) : WidenIndVars(WidenIndVars) {} PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "indvars"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h --- a/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h +++ b/llvm/include/llvm/Transforms/Scalar/InductiveRangeCheckElimination.h @@ -21,6 +21,7 @@ class IRCEPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "irce"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h b/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h --- a/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h +++ b/llvm/include/llvm/Transforms/Scalar/InferAddressSpaces.h @@ -17,6 +17,7 @@ InferAddressSpacesPass(); InferAddressSpacesPass(unsigned AddressSpace); PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "infer-address-spaces"; } private: unsigned FlatAddrSpace = 0; diff --git a/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h b/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h --- a/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h +++ b/llvm/include/llvm/Transforms/Scalar/InstSimplifyPass.h @@ -34,6 +34,7 @@ class InstSimplifyPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "instsimplify"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h --- a/llvm/include/llvm/Transforms/Scalar/JumpThreading.h +++ b/llvm/include/llvm/Transforms/Scalar/JumpThreading.h @@ -98,6 +98,8 @@ public: JumpThreadingPass(bool InsertFreezeWhenUnfoldingSelect = false, int T = -1); + static StringRef name() { return "jump-threading"; } + // Glue for old PM. bool runImpl(Function &F, TargetLibraryInfo *TLI, LazyValueInfo *LVI, AAResults *AA, DomTreeUpdater *DTU, bool HasProfileData, diff --git a/llvm/include/llvm/Transforms/Scalar/LICM.h b/llvm/include/llvm/Transforms/Scalar/LICM.h --- a/llvm/include/llvm/Transforms/Scalar/LICM.h +++ b/llvm/include/llvm/Transforms/Scalar/LICM.h @@ -56,6 +56,7 @@ LicmMssaNoAccForPromotionCap(LicmMssaNoAccForPromotionCap) {} PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "licm"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h b/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h --- a/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopAccessAnalysisPrinter.h @@ -23,6 +23,7 @@ explicit LoopAccessInfoPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "print-access-info"; } }; } // End llvm namespace diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h b/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h --- a/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopDataPrefetch.h @@ -25,6 +25,8 @@ /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "loop-data-prefetch"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h b/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h --- a/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopDeletion.h @@ -27,6 +27,7 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-deletion"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h b/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h --- a/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopDistribute.h @@ -25,6 +25,7 @@ class LoopDistributePass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "loop-distribute"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h b/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h --- a/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopFlatten.h @@ -25,6 +25,8 @@ LoopFlattenPass() = default; PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "loop-flatten"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopFuse.h b/llvm/include/llvm/Transforms/Scalar/LoopFuse.h --- a/llvm/include/llvm/Transforms/Scalar/LoopFuse.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopFuse.h @@ -23,6 +23,7 @@ class LoopFusePass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "loop-fusion"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h b/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h --- a/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopIdiomRecognize.h @@ -41,6 +41,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-idiom"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h b/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h --- a/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopInstSimplify.h @@ -26,6 +26,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-instsimplify"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h b/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h --- a/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopInterchange.h @@ -17,6 +17,7 @@ struct LoopInterchangePass : public PassInfoMixin { PreservedAnalyses run(LoopNest &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-interchange"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h b/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h --- a/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopLoadElimination.h @@ -26,6 +26,7 @@ /// iterations. struct LoopLoadEliminationPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "loop-load-elim"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h --- a/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h @@ -73,6 +73,8 @@ PassManager> { public: + static StringRef name() { return "loop-pass-manager"; } + /// Construct a pass manager. /// /// If \p DebugLogging is true, we'll log our progress to llvm::dbgs(). @@ -217,6 +219,7 @@ (void)AM.template getResult(L, AR); return PreservedAnalyses::all(); } + static StringRef name() { return "require-analysis"; } }; /// An alias template to easily name a require analysis loop pass. @@ -426,6 +429,7 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "function-to-loop-adaptor"; } bool isLoopNestMode() const { return LoopNestMode; } @@ -507,6 +511,8 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &, LoopStandardAnalysisResults &, LPMUpdater &); + + static StringRef name() { return "print"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/LoopPredication.h b/llvm/include/llvm/Transforms/Scalar/LoopPredication.h --- a/llvm/include/llvm/Transforms/Scalar/LoopPredication.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopPredication.h @@ -25,6 +25,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-predication"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopReroll.h b/llvm/include/llvm/Transforms/Scalar/LoopReroll.h --- a/llvm/include/llvm/Transforms/Scalar/LoopReroll.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopReroll.h @@ -20,6 +20,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-reroll"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopRotation.h b/llvm/include/llvm/Transforms/Scalar/LoopRotation.h --- a/llvm/include/llvm/Transforms/Scalar/LoopRotation.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopRotation.h @@ -26,6 +26,7 @@ bool PrepareForLTO = false); PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-rotate"; } private: const bool EnableHeaderDuplication; diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h --- a/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopSimplifyCFG.h @@ -27,6 +27,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-simplifycfg"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopSink.h b/llvm/include/llvm/Transforms/Scalar/LoopSink.h --- a/llvm/include/llvm/Transforms/Scalar/LoopSink.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopSink.h @@ -33,6 +33,7 @@ class LoopSinkPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "loop-sink"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h b/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h --- a/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopStrengthReduce.h @@ -34,6 +34,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-reduce"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h b/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h --- a/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopUnrollAndJamPass.h @@ -21,6 +21,7 @@ public: explicit LoopUnrollAndJamPass(int OptLevel = 2) : OptLevel(OptLevel) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "loop-unroll-and-jam"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h b/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h --- a/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopUnrollPass.h @@ -44,6 +44,7 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "loop-unroll-full"; } }; /// A set of parameters used to control various transforms performed by the @@ -140,6 +141,8 @@ : UnrollOpts(UnrollOpts) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "loop-unroll"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h b/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h --- a/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h +++ b/llvm/include/llvm/Transforms/Scalar/LoopVersioningLICM.h @@ -18,6 +18,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &LAR, LPMUpdater &U); + static StringRef name() { return "loop-versioning-licm"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LowerAtomic.h b/llvm/include/llvm/Transforms/Scalar/LowerAtomic.h --- a/llvm/include/llvm/Transforms/Scalar/LowerAtomic.h +++ b/llvm/include/llvm/Transforms/Scalar/LowerAtomic.h @@ -23,6 +23,7 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &); static bool isRequired() { return true; } + static StringRef name() { return "loweratomic"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h b/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h --- a/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h +++ b/llvm/include/llvm/Transforms/Scalar/LowerConstantIntrinsics.h @@ -34,6 +34,8 @@ /// This complements the Instruction Simplification and /// Instruction Combination passes of the optimized pass chain. PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + + static StringRef name() { return "lower-constant-intrinsics"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h b/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h --- a/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h +++ b/llvm/include/llvm/Transforms/Scalar/LowerExpectIntrinsic.h @@ -30,6 +30,7 @@ /// no more expect intrinsics remain, allowing the rest of the optimizer to /// ignore them. PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "lower-expect"; } }; extern cl::opt LikelyBranchWeight; diff --git a/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h b/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h --- a/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h +++ b/llvm/include/llvm/Transforms/Scalar/LowerGuardIntrinsic.h @@ -20,6 +20,7 @@ struct LowerGuardIntrinsicPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "lower-guard-intrinsic"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h b/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h --- a/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h +++ b/llvm/include/llvm/Transforms/Scalar/LowerMatrixIntrinsics.h @@ -24,6 +24,7 @@ LowerMatrixIntrinsicsPass(bool Minimal = false) : Minimal(Minimal) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "lower-matrix-intrinsics"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h b/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h --- a/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h +++ b/llvm/include/llvm/Transforms/Scalar/LowerWidenableCondition.h @@ -19,6 +19,7 @@ struct LowerWidenableConditionPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "lower-widenable-condition"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h b/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h --- a/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h +++ b/llvm/include/llvm/Transforms/Scalar/MakeGuardsExplicit.h @@ -39,6 +39,7 @@ struct MakeGuardsExplicitPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "make-guards-explicit"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h b/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h --- a/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h +++ b/llvm/include/llvm/Transforms/Scalar/MemCpyOptimizer.h @@ -53,6 +53,8 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "memcpyopt"; } + // Glue for the old PM. bool runImpl(Function &F, MemoryDependenceResults *MD, TargetLibraryInfo *TLI, AAResults *AA, AssumptionCache *AC, DominatorTree *DT, diff --git a/llvm/include/llvm/Transforms/Scalar/MergeICmps.h b/llvm/include/llvm/Transforms/Scalar/MergeICmps.h --- a/llvm/include/llvm/Transforms/Scalar/MergeICmps.h +++ b/llvm/include/llvm/Transforms/Scalar/MergeICmps.h @@ -18,6 +18,7 @@ struct MergeICmpsPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "mergeicmps"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h b/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h --- a/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h +++ b/llvm/include/llvm/Transforms/Scalar/MergedLoadStoreMotion.h @@ -48,6 +48,7 @@ MergedLoadStoreMotionPass(const MergedLoadStoreMotionOptions &PassOptions) : Options(PassOptions) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "mldst-motion"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h b/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h --- a/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h +++ b/llvm/include/llvm/Transforms/Scalar/NaryReassociate.h @@ -103,6 +103,8 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "nary-reassociate"; } + // Glue for old PM. bool runImpl(Function &F, AssumptionCache *AC_, DominatorTree *DT_, ScalarEvolution *SE_, TargetLibraryInfo *TLI_, diff --git a/llvm/include/llvm/Transforms/Scalar/NewGVN.h b/llvm/include/llvm/Transforms/Scalar/NewGVN.h --- a/llvm/include/llvm/Transforms/Scalar/NewGVN.h +++ b/llvm/include/llvm/Transforms/Scalar/NewGVN.h @@ -24,6 +24,7 @@ public: /// Run the pass over the function. PreservedAnalyses run(Function &F, AnalysisManager &AM); + static StringRef name() { return "newgvn"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h b/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h --- a/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h +++ b/llvm/include/llvm/Transforms/Scalar/PartiallyInlineLibCalls.h @@ -23,6 +23,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "partially-inline-libcalls"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/Reassociate.h b/llvm/include/llvm/Transforms/Scalar/Reassociate.h --- a/llvm/include/llvm/Transforms/Scalar/Reassociate.h +++ b/llvm/include/llvm/Transforms/Scalar/Reassociate.h @@ -95,6 +95,7 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "reassociate"; } private: void BuildRankMap(Function &F, ReversePostOrderTraversal &RPOT); diff --git a/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h b/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h --- a/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h +++ b/llvm/include/llvm/Transforms/Scalar/Reg2Mem.h @@ -20,6 +20,7 @@ class RegToMemPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "reg2mem"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h b/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h --- a/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h +++ b/llvm/include/llvm/Transforms/Scalar/RewriteStatepointsForGC.h @@ -31,6 +31,8 @@ bool runOnFunction(Function &F, DominatorTree &, TargetTransformInfo &, const TargetLibraryInfo &); + + static StringRef name() { return "rewrite-statepoints-for-gc"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/SCCP.h b/llvm/include/llvm/Transforms/Scalar/SCCP.h --- a/llvm/include/llvm/Transforms/Scalar/SCCP.h +++ b/llvm/include/llvm/Transforms/Scalar/SCCP.h @@ -36,6 +36,7 @@ class SCCPPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "sccp"; } }; /// Helper struct for bundling up the analysis results per function for IPSCCP. diff --git a/llvm/include/llvm/Transforms/Scalar/SROA.h b/llvm/include/llvm/Transforms/Scalar/SROA.h --- a/llvm/include/llvm/Transforms/Scalar/SROA.h +++ b/llvm/include/llvm/Transforms/Scalar/SROA.h @@ -115,6 +115,8 @@ /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "sroa"; } + private: friend class sroa::AllocaSliceRewriter; friend class sroa::SROALegacyPass; diff --git a/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h b/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h --- a/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h +++ b/llvm/include/llvm/Transforms/Scalar/ScalarizeMaskedMemIntrin.h @@ -23,6 +23,7 @@ struct ScalarizeMaskedMemIntrinPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "scalarize-masked-mem-intrin"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h --- a/llvm/include/llvm/Transforms/Scalar/Scalarizer.h +++ b/llvm/include/llvm/Transforms/Scalar/Scalarizer.h @@ -24,6 +24,7 @@ class ScalarizerPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "scalarizer"; } }; /// Create a legacy pass manager instance of the Scalarizer pass diff --git a/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h b/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h --- a/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h +++ b/llvm/include/llvm/Transforms/Scalar/SeparateConstOffsetFromGEP.h @@ -20,6 +20,7 @@ public: SeparateConstOffsetFromGEPPass(bool LowerGEP = false) : LowerGEP(LowerGEP) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "separate-const-offset-from-gep"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h b/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h --- a/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h +++ b/llvm/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h @@ -67,6 +67,7 @@ PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "simple-loop-unswitch"; } }; /// Create the legacy pass object for the simple loop unswitcher. diff --git a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h --- a/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h +++ b/llvm/include/llvm/Transforms/Scalar/SimplifyCFG.h @@ -41,6 +41,8 @@ /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "simplifycfg"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/Sink.h b/llvm/include/llvm/Transforms/Scalar/Sink.h --- a/llvm/include/llvm/Transforms/Scalar/Sink.h +++ b/llvm/include/llvm/Transforms/Scalar/Sink.h @@ -23,6 +23,7 @@ class SinkingPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "sink"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h b/llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h --- a/llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h +++ b/llvm/include/llvm/Transforms/Scalar/SpeculateAroundPHIs.h @@ -103,6 +103,7 @@ struct SpeculateAroundPHIsPass : PassInfoMixin { /// Run the pass over the function. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "spec-phis"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h b/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h --- a/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h +++ b/llvm/include/llvm/Transforms/Scalar/SpeculativeExecution.h @@ -73,6 +73,8 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "speculative-execution"; } + // Glue for old PM bool runImpl(Function &F, TargetTransformInfo *TTI); diff --git a/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h b/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h --- a/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h +++ b/llvm/include/llvm/Transforms/Scalar/StraightLineStrengthReduce.h @@ -17,6 +17,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "slsr"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h b/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h --- a/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h +++ b/llvm/include/llvm/Transforms/Scalar/StructurizeCFG.h @@ -14,6 +14,7 @@ namespace llvm { struct StructurizeCFGPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "structurizecfg"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h b/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h --- a/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h +++ b/llvm/include/llvm/Transforms/Scalar/TailRecursionElimination.h @@ -59,6 +59,7 @@ struct TailCallElimPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "tailcallelim"; } }; } diff --git a/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h b/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h --- a/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h +++ b/llvm/include/llvm/Transforms/Scalar/WarnMissedTransforms.h @@ -27,6 +27,8 @@ explicit WarnMissedTransformationsPass() {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + + static StringRef name() { return "transform-warning"; } }; // Legacy pass manager boilerplate. diff --git a/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h b/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h --- a/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h +++ b/llvm/include/llvm/Transforms/Utils/AddDiscriminators.h @@ -24,6 +24,7 @@ class AddDiscriminatorsPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "add-discriminators"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h --- a/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h +++ b/llvm/include/llvm/Transforms/Utils/AssumeBundleBuilder.h @@ -53,6 +53,7 @@ /// information. struct AssumeSimplifyPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "assume-simplify"; } }; FunctionPass *createAssumeSimplifyPass(); @@ -61,6 +62,7 @@ /// function. Its main purpose is testing. struct AssumeBuilderPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "assume-builder"; } }; /// canonicalize the RetainedKnowledge RK. it is assumed that RK is part of diff --git a/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h b/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h --- a/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h +++ b/llvm/include/llvm/Transforms/Utils/BreakCriticalEdges.h @@ -23,6 +23,7 @@ namespace llvm { struct BreakCriticalEdgesPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "break-crit-edges"; } }; } // namespace llvm #endif // LLVM_TRANSFORMS_UTILS_BREAKCRITICALEDGES_H diff --git a/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h b/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h --- a/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h +++ b/llvm/include/llvm/Transforms/Utils/CanonicalizeAliases.h @@ -24,6 +24,7 @@ CanonicalizeAliasesPass() = default; PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "canonicalize-aliases"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h b/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h --- a/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h +++ b/llvm/include/llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h @@ -26,6 +26,7 @@ public: PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "canon-freeze"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/Debugify.h b/llvm/include/llvm/Transforms/Utils/Debugify.h --- a/llvm/include/llvm/Transforms/Utils/Debugify.h +++ b/llvm/include/llvm/Transforms/Utils/Debugify.h @@ -101,6 +101,7 @@ struct NewPMDebugifyPass : public llvm::PassInfoMixin { llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM); + static llvm::StringRef name() { return "debugify"; } }; /// Track how much `debugify` information (in the `synthetic` mode only) @@ -147,6 +148,7 @@ struct NewPMCheckDebugifyPass : public llvm::PassInfoMixin { llvm::PreservedAnalyses run(llvm::Module &M, llvm::ModuleAnalysisManager &AM); + static llvm::StringRef name() { return "check-debugify"; } }; namespace llvm { diff --git a/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h b/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h --- a/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h +++ b/llvm/include/llvm/Transforms/Utils/EntryExitInstrumenter.h @@ -30,6 +30,7 @@ bool PostInlining; static bool isRequired() { return true; } + static StringRef name() { return "ee-instrument"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/FixIrreducible.h b/llvm/include/llvm/Transforms/Utils/FixIrreducible.h --- a/llvm/include/llvm/Transforms/Utils/FixIrreducible.h +++ b/llvm/include/llvm/Transforms/Utils/FixIrreducible.h @@ -14,6 +14,7 @@ namespace llvm { struct FixIrreduciblePass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "fix-irreducible"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/HelloWorld.h b/llvm/include/llvm/Transforms/Utils/HelloWorld.h --- a/llvm/include/llvm/Transforms/Utils/HelloWorld.h +++ b/llvm/include/llvm/Transforms/Utils/HelloWorld.h @@ -16,6 +16,7 @@ class HelloWorldPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "helloworld"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h b/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h --- a/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h +++ b/llvm/include/llvm/Transforms/Utils/InjectTLIMappings.h @@ -20,6 +20,7 @@ class InjectTLIMappings : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "inject-tli-mappings"; } }; // Legacy pass diff --git a/llvm/include/llvm/Transforms/Utils/InstructionNamer.h b/llvm/include/llvm/Transforms/Utils/InstructionNamer.h --- a/llvm/include/llvm/Transforms/Utils/InstructionNamer.h +++ b/llvm/include/llvm/Transforms/Utils/InstructionNamer.h @@ -14,6 +14,7 @@ namespace llvm { struct InstructionNamerPass : PassInfoMixin { PreservedAnalyses run(Function &, FunctionAnalysisManager &); + static StringRef name() { return "instnamer"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/LCSSA.h b/llvm/include/llvm/Transforms/Utils/LCSSA.h --- a/llvm/include/llvm/Transforms/Utils/LCSSA.h +++ b/llvm/include/llvm/Transforms/Utils/LCSSA.h @@ -37,6 +37,7 @@ class LCSSAPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "lcssa"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h b/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h --- a/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h +++ b/llvm/include/llvm/Transforms/Utils/LibCallsShrinkWrap.h @@ -17,9 +17,9 @@ class LibCallsShrinkWrapPass : public PassInfoMixin { public: - static StringRef name() { return "LibCallsShrinkWrapPass"; } - PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + + static StringRef name() { return "libcalls-shrinkwrap"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/LoopSimplify.h b/llvm/include/llvm/Transforms/Utils/LoopSimplify.h --- a/llvm/include/llvm/Transforms/Utils/LoopSimplify.h +++ b/llvm/include/llvm/Transforms/Utils/LoopSimplify.h @@ -53,6 +53,7 @@ class LoopSimplifyPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "loop-simplify"; } }; /// Simplify each loop in a loop nest recursively. diff --git a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h --- a/llvm/include/llvm/Transforms/Utils/LoopVersioning.h +++ b/llvm/include/llvm/Transforms/Utils/LoopVersioning.h @@ -149,6 +149,7 @@ class LoopVersioningPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM); + static StringRef name() { return "loop-versioning"; } }; } diff --git a/llvm/include/llvm/Transforms/Utils/LowerInvoke.h b/llvm/include/llvm/Transforms/Utils/LowerInvoke.h --- a/llvm/include/llvm/Transforms/Utils/LowerInvoke.h +++ b/llvm/include/llvm/Transforms/Utils/LowerInvoke.h @@ -22,6 +22,7 @@ class LowerInvokePass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "lowerinvoke"; } }; } diff --git a/llvm/include/llvm/Transforms/Utils/LowerSwitch.h b/llvm/include/llvm/Transforms/Utils/LowerSwitch.h --- a/llvm/include/llvm/Transforms/Utils/LowerSwitch.h +++ b/llvm/include/llvm/Transforms/Utils/LowerSwitch.h @@ -20,6 +20,7 @@ namespace llvm { struct LowerSwitchPass : public PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "lowerswitch"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/Mem2Reg.h b/llvm/include/llvm/Transforms/Utils/Mem2Reg.h --- a/llvm/include/llvm/Transforms/Utils/Mem2Reg.h +++ b/llvm/include/llvm/Transforms/Utils/Mem2Reg.h @@ -23,6 +23,7 @@ class PromotePass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "mem2reg"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/MetaRenamer.h b/llvm/include/llvm/Transforms/Utils/MetaRenamer.h --- a/llvm/include/llvm/Transforms/Utils/MetaRenamer.h +++ b/llvm/include/llvm/Transforms/Utils/MetaRenamer.h @@ -20,6 +20,7 @@ namespace llvm { struct MetaRenamerPass : PassInfoMixin { PreservedAnalyses run(Module &, ModuleAnalysisManager &); + static StringRef name() { return "metarenamer"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h --- a/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h +++ b/llvm/include/llvm/Transforms/Utils/NameAnonGlobals.h @@ -25,6 +25,7 @@ NameAnonGlobalPass() = default; PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "name-anon-globals"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h --- a/llvm/include/llvm/Transforms/Utils/PredicateInfo.h +++ b/llvm/include/llvm/Transforms/Utils/PredicateInfo.h @@ -229,6 +229,7 @@ public: explicit PredicateInfoPrinterPass(raw_ostream &OS) : OS(OS) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "print-predicateinfo"; } }; /// Verifier pass for \c PredicateInfo. diff --git a/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h b/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h --- a/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h +++ b/llvm/include/llvm/Transforms/Utils/StripGCRelocates.h @@ -18,6 +18,7 @@ class StripGCRelocates : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "strip-gc-relocates"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h b/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h --- a/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h +++ b/llvm/include/llvm/Transforms/Utils/StripNonLineTableDebugInfo.h @@ -19,6 +19,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "strip-nonlinetable-debuginfo"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h b/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h --- a/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h +++ b/llvm/include/llvm/Transforms/Utils/SymbolRewriter.h @@ -127,6 +127,8 @@ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "rewrite-symbols"; } + // Glue for old PM bool runImpl(Module &M); diff --git a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h --- a/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h +++ b/llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h @@ -38,6 +38,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "mergereturn"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h b/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h --- a/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h +++ b/llvm/include/llvm/Transforms/Utils/UnifyLoopExits.h @@ -16,6 +16,7 @@ class UnifyLoopExitsPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "unify-loop-exits"; } }; } // namespace llvm diff --git a/llvm/include/llvm/Transforms/Utils/UniqueInternalLinkageNames.h b/llvm/include/llvm/Transforms/Utils/UniqueInternalLinkageNames.h --- a/llvm/include/llvm/Transforms/Utils/UniqueInternalLinkageNames.h +++ b/llvm/include/llvm/Transforms/Utils/UniqueInternalLinkageNames.h @@ -24,6 +24,7 @@ : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "unique-internal-linkage-names"; } }; } // end namespace llvm diff --git a/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h --- a/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h +++ b/llvm/include/llvm/Transforms/Vectorize/LoadStoreVectorizer.h @@ -16,6 +16,7 @@ class LoadStoreVectorizerPass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "load-store-vectorizer"; } }; /// Create a legacy pass manager instance of the LoadStoreVectorizer pass diff --git a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h --- a/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h +++ b/llvm/include/llvm/Transforms/Vectorize/LoopVectorize.h @@ -154,6 +154,8 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "loop-vectorize"; } + // Shim for old PM. LoopVectorizeResult runImpl(Function &F, ScalarEvolution &SE_, LoopInfo &LI_, diff --git a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h --- a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h +++ b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h @@ -74,6 +74,8 @@ public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "slp-vectorizer"; } + // Glue for old PM. bool runImpl(Function &F, ScalarEvolution *SE_, TargetTransformInfo *TTI_, TargetLibraryInfo *TLI_, AAResults *AA_, LoopInfo *LI_, diff --git a/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h b/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h --- a/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h +++ b/llvm/include/llvm/Transforms/Vectorize/VectorCombine.h @@ -23,6 +23,7 @@ struct VectorCombinePass : public PassInfoMixin { public: PreservedAnalyses run(Function &F, FunctionAnalysisManager &); + static StringRef name() { return "vector-combine"; } }; } diff --git a/llvm/lib/IR/PassInstrumentation.cpp b/llvm/lib/IR/PassInstrumentation.cpp --- a/llvm/lib/IR/PassInstrumentation.cpp +++ b/llvm/lib/IR/PassInstrumentation.cpp @@ -17,16 +17,6 @@ namespace llvm { -void PassInstrumentationCallbacks::addClassToPassName(StringRef ClassName, - StringRef PassName) { - ClassToPassName[ClassName] = PassName.str(); -} - -StringRef -PassInstrumentationCallbacks::getPassNameForClassName(StringRef ClassName) { - return ClassToPassName[ClassName]; -} - AnalysisKey PassInstrumentationAnalysis::Key; bool isSpecialPass(StringRef PassID, const std::vector &Specials) { diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -347,7 +347,7 @@ return PreservedAnalyses::all(); } - static StringRef name() { return "NoOpModulePass"; } + static StringRef name() { return "no-op-module"; } }; /// No-op module analysis. @@ -358,7 +358,7 @@ public: struct Result {}; Result run(Module &, ModuleAnalysisManager &) { return Result(); } - static StringRef name() { return "NoOpModuleAnalysis"; } + static StringRef name() { return "no-op-module"; } }; /// No-op CGSCC pass which does nothing. @@ -367,7 +367,7 @@ LazyCallGraph &, CGSCCUpdateResult &UR) { return PreservedAnalyses::all(); } - static StringRef name() { return "NoOpCGSCCPass"; } + static StringRef name() { return "no-op-cgscc"; } }; /// No-op CGSCC analysis. @@ -380,7 +380,7 @@ Result run(LazyCallGraph::SCC &, CGSCCAnalysisManager &, LazyCallGraph &G) { return Result(); } - static StringRef name() { return "NoOpCGSCCAnalysis"; } + static StringRef name() { return "no-op-cgscc"; } }; /// No-op function pass which does nothing. @@ -388,7 +388,7 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &) { return PreservedAnalyses::all(); } - static StringRef name() { return "NoOpFunctionPass"; } + static StringRef name() { return "no-op-function"; } }; /// No-op function analysis. @@ -399,7 +399,7 @@ public: struct Result {}; Result run(Function &, FunctionAnalysisManager &) { return Result(); } - static StringRef name() { return "NoOpFunctionAnalysis"; } + static StringRef name() { return "no-op-function"; } }; /// No-op loop pass which does nothing. @@ -408,7 +408,7 @@ LoopStandardAnalysisResults &, LPMUpdater &) { return PreservedAnalyses::all(); } - static StringRef name() { return "NoOpLoopPass"; } + static StringRef name() { return "no-op-loop"; } }; /// No-op loop analysis. @@ -421,7 +421,7 @@ Result run(Loop &, LoopAnalysisManager &, LoopStandardAnalysisResults &) { return Result(); } - static StringRef name() { return "NoOpLoopAnalysis"; } + static StringRef name() { return "no-op-loop"; } }; AnalysisKey NoOpModuleAnalysis::Key; @@ -435,9 +435,9 @@ /// This is for optimization purposes so we don't populate it if we never use /// it. This should be updated if new pass instrumentation wants to use the map. /// We currently only use this for --print-before/after. -bool shouldPopulateClassToPassNames() { - return !printBeforePasses().empty() || !printAfterPasses().empty(); -} +// bool shouldPopulateClassToPassNames() { +// return !printBeforePasses().empty() || !printAfterPasses().empty(); +// } } // namespace @@ -447,25 +447,6 @@ : DebugLogging(DebugLogging), TM(TM), PTO(PTO), PGOOpt(PGOOpt), PIC(PIC) { if (TM) TM->registerPassBuilderCallbacks(*this, DebugLogging); - if (PIC && shouldPopulateClassToPassNames()) { -#define MODULE_PASS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define MODULE_ANALYSIS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define FUNCTION_PASS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define LOOP_PASS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define LOOP_ANALYSIS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define CGSCC_PASS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ - PIC->addClassToPassName(decltype(CREATE_PASS)::name(), NAME); -#include "PassRegistry.def" - } } void PassBuilder::invokePeepholeEPCallbacks( @@ -2321,7 +2302,8 @@ if (Name == NAME) \ return true; #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ + if (Name == "require<" + std::string(NAME) + ">" || \ + Name == "invalidate<" + std::string(NAME) + ">") \ return true; #include "PassRegistry.def" @@ -2346,7 +2328,8 @@ if (Name == NAME) \ return true; #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ + if (Name == "require<" + std::string(NAME) + ">" || \ + Name == "invalidate<" + std::string(NAME) + ">") \ return true; #include "PassRegistry.def" @@ -2372,7 +2355,8 @@ if (checkParametrizedPassName(Name, NAME)) \ return true; #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ + if (Name == "require<" + std::string(NAME) + ">" || \ + Name == "invalidate<" + std::string(NAME) + ">") \ return true; #include "PassRegistry.def" @@ -2396,7 +2380,8 @@ if (checkParametrizedPassName(Name, NAME)) \ return true; #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">" || Name == "invalidate<" NAME ">") \ + if (Name == "require<" + std::string(NAME) + ">" || \ + Name == "invalidate<" + std::string(NAME) + ">") \ return true; #include "PassRegistry.def" @@ -2561,13 +2546,13 @@ return Error::success(); \ } #define MODULE_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">") { \ + if (Name == "require<" + std::string(NAME) + ">") { \ MPM.addPass( \ RequireAnalysisPass< \ std::remove_reference::type, Module>()); \ return Error::success(); \ } \ - if (Name == "invalidate<" NAME ">") { \ + if (Name == "invalidate<" + std::string(NAME) + ">") { \ MPM.addPass(InvalidateAnalysisPass< \ std::remove_reference::type>()); \ return Error::success(); \ @@ -2673,14 +2658,14 @@ return Error::success(); \ } #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">") { \ + if (Name == "require<" + std::string(NAME) + ">") { \ CGPM.addPass(RequireAnalysisPass< \ std::remove_reference::type, \ LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, \ CGSCCUpdateResult &>()); \ return Error::success(); \ } \ - if (Name == "invalidate<" NAME ">") { \ + if (Name == "invalidate<" + std::string(NAME) + ">") { \ CGPM.addPass(InvalidateAnalysisPass< \ std::remove_reference::type>()); \ return Error::success(); \ @@ -2785,13 +2770,13 @@ return Error::success(); \ } #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">") { \ + if (Name == "require<" + std::string(NAME) + ">") { \ FPM.addPass( \ RequireAnalysisPass< \ std::remove_reference::type, Function>()); \ return Error::success(); \ } \ - if (Name == "invalidate<" NAME ">") { \ + if (Name == "invalidate<" + std::string(NAME) + ">") { \ FPM.addPass(InvalidateAnalysisPass< \ std::remove_reference::type>()); \ return Error::success(); \ @@ -2873,14 +2858,14 @@ return Error::success(); \ } #define LOOP_ANALYSIS(NAME, CREATE_PASS) \ - if (Name == "require<" NAME ">") { \ + if (Name == "require<" + std::string(NAME) + ">") { \ LPM.addPass(RequireAnalysisPass< \ std::remove_reference::type, Loop, \ LoopAnalysisManager, LoopStandardAnalysisResults &, \ LPMUpdater &>()); \ return Error::success(); \ } \ - if (Name == "invalidate<" NAME ">") { \ + if (Name == "invalidate<" + std::string(NAME) + ">") { \ LPM.addPass(InvalidateAnalysisPass< \ std::remove_reference::type>()); \ return Error::success(); \ diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -18,73 +18,98 @@ #ifndef MODULE_ANALYSIS #define MODULE_ANALYSIS(NAME, CREATE_PASS) #endif -MODULE_ANALYSIS("callgraph", CallGraphAnalysis()) -MODULE_ANALYSIS("lcg", LazyCallGraphAnalysis()) -MODULE_ANALYSIS("module-summary", ModuleSummaryIndexAnalysis()) -MODULE_ANALYSIS("no-op-module", NoOpModuleAnalysis()) -MODULE_ANALYSIS("profile-summary", ProfileSummaryAnalysis()) -MODULE_ANALYSIS("stack-safety", StackSafetyGlobalAnalysis()) -MODULE_ANALYSIS("verify", VerifierAnalysis()) +#define MODULE_ANALYSIS_DEFAULT_NAME(CREATE_PASS) MODULE_ANALYSIS(decltype(CREATE_PASS)::name(), CREATE_PASS) +MODULE_ANALYSIS_DEFAULT_NAME(CallGraphAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(LazyCallGraphAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(ModuleSummaryIndexAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(NoOpModuleAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(ProfileSummaryAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(StackSafetyGlobalAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(VerifierAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(ASanGlobalsMetadataAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(InlineAdvisorAnalysis()) +MODULE_ANALYSIS_DEFAULT_NAME(IRSimilarityAnalysis()) MODULE_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) -MODULE_ANALYSIS("asan-globals-md", ASanGlobalsMetadataAnalysis()) -MODULE_ANALYSIS("inline-advisor", InlineAdvisorAnalysis()) -MODULE_ANALYSIS("ir-similarity", IRSimilarityAnalysis()) +#undef MODULE_ANALYSIS_DEFAULT_NAME #ifndef MODULE_ALIAS_ANALYSIS -#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ - MODULE_ANALYSIS(NAME, CREATE_PASS) +#define MODULE_ALIAS_ANALYSIS(NAME, CREATE_PASS) MODULE_ANALYSIS(NAME, CREATE_PASS) #endif -MODULE_ALIAS_ANALYSIS("globals-aa", GlobalsAA()) +#define MODULE_ALIAS_ANALYSIS_DEFAULT_NAME(CREATE_PASS) MODULE_ALIAS_ANALYSIS(decltype(CREATE_PASS)::name(), CREATE_PASS) +MODULE_ALIAS_ANALYSIS_DEFAULT_NAME(GlobalsAA()) +#undef MODULE_ALIAS_ANALYSIS_DEFAULT_NAME #undef MODULE_ALIAS_ANALYSIS #undef MODULE_ANALYSIS #ifndef MODULE_PASS #define MODULE_PASS(NAME, CREATE_PASS) #endif -MODULE_PASS("always-inline", AlwaysInlinerPass()) -MODULE_PASS("attributor", AttributorPass()) -MODULE_PASS("annotation2metadata", Annotation2MetadataPass()) -MODULE_PASS("called-value-propagation", CalledValuePropagationPass()) -MODULE_PASS("canonicalize-aliases", CanonicalizeAliasesPass()) -MODULE_PASS("cg-profile", CGProfilePass()) -MODULE_PASS("constmerge", ConstantMergePass()) -MODULE_PASS("cross-dso-cfi", CrossDSOCFIPass()) -MODULE_PASS("deadargelim", DeadArgumentEliminationPass()) -MODULE_PASS("elim-avail-extern", EliminateAvailableExternallyPass()) -MODULE_PASS("extract-blocks", BlockExtractorPass()) -MODULE_PASS("forceattrs", ForceFunctionAttrsPass()) -MODULE_PASS("function-import", FunctionImportPass()) -MODULE_PASS("globaldce", GlobalDCEPass()) -MODULE_PASS("globalopt", GlobalOptPass()) -MODULE_PASS("globalsplit", GlobalSplitPass()) -MODULE_PASS("hotcoldsplit", HotColdSplittingPass()) -MODULE_PASS("hwasan", HWAddressSanitizerPass(false, false)) +#define MODULE_PASS_DEFAULT_NAME(CREATE_PASS) MODULE_PASS(decltype(CREATE_PASS)::name(), CREATE_PASS) +MODULE_PASS_DEFAULT_NAME(AlwaysInlinerPass()) +MODULE_PASS_DEFAULT_NAME(AttributorPass()) +MODULE_PASS_DEFAULT_NAME(Annotation2MetadataPass()) +MODULE_PASS_DEFAULT_NAME(CalledValuePropagationPass()) +MODULE_PASS_DEFAULT_NAME(CanonicalizeAliasesPass()) +MODULE_PASS_DEFAULT_NAME(CGProfilePass()) +MODULE_PASS_DEFAULT_NAME(ConstantMergePass()) +MODULE_PASS_DEFAULT_NAME(CrossDSOCFIPass()) +MODULE_PASS_DEFAULT_NAME(DeadArgumentEliminationPass()) +MODULE_PASS_DEFAULT_NAME(EliminateAvailableExternallyPass()) +MODULE_PASS_DEFAULT_NAME(BlockExtractorPass()) +MODULE_PASS_DEFAULT_NAME(ForceFunctionAttrsPass()) +MODULE_PASS_DEFAULT_NAME(FunctionImportPass()) +MODULE_PASS_DEFAULT_NAME(GlobalDCEPass()) +MODULE_PASS_DEFAULT_NAME(GlobalOptPass()) +MODULE_PASS_DEFAULT_NAME(GlobalSplitPass()) +MODULE_PASS_DEFAULT_NAME(HotColdSplittingPass()) +MODULE_PASS_DEFAULT_NAME(InferFunctionAttrsPass()) +MODULE_PASS_DEFAULT_NAME(ModuleInlinerWrapperPass()) +MODULE_PASS_DEFAULT_NAME(GCOVProfilerPass()) +MODULE_PASS_DEFAULT_NAME(InstrOrderFilePass()) +MODULE_PASS_DEFAULT_NAME(InstrProfiling()) +MODULE_PASS_DEFAULT_NAME(InternalizePass()) +MODULE_PASS_DEFAULT_NAME(InvalidateAllAnalysesPass()) +MODULE_PASS_DEFAULT_NAME(IPSCCPPass()) +MODULE_PASS_DEFAULT_NAME(IROutlinerPass()) +MODULE_PASS_DEFAULT_NAME(LoopExtractorPass()) +MODULE_PASS_DEFAULT_NAME(LowerTypeTestsPass()) +MODULE_PASS_DEFAULT_NAME(MetaRenamerPass()) +MODULE_PASS_DEFAULT_NAME(MergeFunctionsPass()) +MODULE_PASS_DEFAULT_NAME(NameAnonGlobalPass()) +MODULE_PASS_DEFAULT_NAME(NoOpModulePass()) +MODULE_PASS_DEFAULT_NAME(ObjCARCAPElimPass()) +MODULE_PASS_DEFAULT_NAME(PartialInlinerPass()) +MODULE_PASS_DEFAULT_NAME(PGOIndirectCallPromotion()) +MODULE_PASS_DEFAULT_NAME(PGOInstrumentationGen()) +MODULE_PASS_DEFAULT_NAME(PGOInstrumentationUse()) +MODULE_PASS_DEFAULT_NAME(RewriteStatepointsForGC()) +MODULE_PASS_DEFAULT_NAME(RewriteSymbolPass()) +MODULE_PASS_DEFAULT_NAME(ReversePostOrderFunctionAttrsPass()) +MODULE_PASS_DEFAULT_NAME(SampleProfileLoaderPass()) +MODULE_PASS_DEFAULT_NAME(StripSymbolsPass()) +MODULE_PASS_DEFAULT_NAME(StripDeadDebugInfoPass()) +MODULE_PASS_DEFAULT_NAME(StripDeadPrototypesPass()) +MODULE_PASS_DEFAULT_NAME(StripDebugDeclarePass()) +MODULE_PASS_DEFAULT_NAME(StripNonDebugSymbolsPass()) +MODULE_PASS_DEFAULT_NAME(StripNonLineTableDebugInfoPass()) +MODULE_PASS_DEFAULT_NAME(SyntheticCountsPropagation()) +MODULE_PASS_DEFAULT_NAME(UniqueInternalLinkageNamesPass()) +MODULE_PASS_DEFAULT_NAME(VerifierPass()) +MODULE_PASS_DEFAULT_NAME(WholeProgramDevirtPass()) +MODULE_PASS_DEFAULT_NAME(DataFlowSanitizerPass()) +MODULE_PASS_DEFAULT_NAME(HWAddressSanitizerPass(false, false)) +MODULE_PASS_DEFAULT_NAME(MemorySanitizerPass({})) +MODULE_PASS_DEFAULT_NAME(ThreadSanitizerPass()) +MODULE_PASS_DEFAULT_NAME(ModuleSanitizerCoveragePass()) +MODULE_PASS_DEFAULT_NAME(ModuleMemProfilerPass()) +MODULE_PASS_DEFAULT_NAME(PoisonCheckingPass()) +MODULE_PASS_DEFAULT_NAME(PseudoProbeUpdatePass()) MODULE_PASS("khwasan", HWAddressSanitizerPass(true, true)) -MODULE_PASS("inferattrs", InferFunctionAttrsPass()) -MODULE_PASS("inliner-wrapper", ModuleInlinerWrapperPass()) MODULE_PASS("inliner-wrapper-no-mandatory-first", ModuleInlinerWrapperPass( getInlineParams(), DebugLogging, false)) -MODULE_PASS("insert-gcov-profiling", GCOVProfilerPass()) -MODULE_PASS("instrorderfile", InstrOrderFilePass()) -MODULE_PASS("instrprof", InstrProfiling()) -MODULE_PASS("internalize", InternalizePass()) -MODULE_PASS("invalidate", InvalidateAllAnalysesPass()) -MODULE_PASS("ipsccp", IPSCCPPass()) -MODULE_PASS("iroutliner", IROutlinerPass()) MODULE_PASS("print-ir-similarity", IRSimilarityAnalysisPrinterPass(dbgs())) -MODULE_PASS("loop-extract", LoopExtractorPass()) -MODULE_PASS("lowertypetests", LowerTypeTestsPass()) -MODULE_PASS("metarenamer", MetaRenamerPass()) -MODULE_PASS("mergefunc", MergeFunctionsPass()) -MODULE_PASS("name-anon-globals", NameAnonGlobalPass()) -MODULE_PASS("no-op-module", NoOpModulePass()) -MODULE_PASS("objc-arc-apelim", ObjCARCAPElimPass()) -MODULE_PASS("partial-inliner", PartialInlinerPass()) -MODULE_PASS("pgo-icall-prom", PGOIndirectCallPromotion()) -MODULE_PASS("pgo-instr-gen", PGOInstrumentationGen()) -MODULE_PASS("pgo-instr-use", PGOInstrumentationUse()) MODULE_PASS("print-profile-summary", ProfileSummaryPrinterPass(dbgs())) MODULE_PASS("print-callgraph", CallGraphPrinterPass(dbgs())) MODULE_PASS("print", PrintModulePass(dbgs())) @@ -93,182 +118,204 @@ MODULE_PASS("print-must-be-executed-contexts", MustBeExecutedContextPrinterPass(dbgs())) MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs())) MODULE_PASS("print", ModuleDebugInfoPrinterPass(dbgs())) -MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC()) -MODULE_PASS("rewrite-symbols", RewriteSymbolPass()) -MODULE_PASS("rpo-function-attrs", ReversePostOrderFunctionAttrsPass()) -MODULE_PASS("sample-profile", SampleProfileLoaderPass()) MODULE_PASS("scc-oz-module-inliner", buildInlinerPipeline(OptimizationLevel::Oz, ThinOrFullLTOPhase::None)) MODULE_PASS("loop-extract-single", LoopExtractorPass(1)) -MODULE_PASS("strip", StripSymbolsPass()) -MODULE_PASS("strip-dead-debug-info", StripDeadDebugInfoPass()) MODULE_PASS("pseudo-probe", SampleProfileProbePass(TM)) -MODULE_PASS("strip-dead-prototypes", StripDeadPrototypesPass()) -MODULE_PASS("strip-debug-declare", StripDebugDeclarePass()) -MODULE_PASS("strip-nondebug", StripNonDebugSymbolsPass()) -MODULE_PASS("strip-nonlinetable-debuginfo", StripNonLineTableDebugInfoPass()) -MODULE_PASS("synthetic-counts-propagation", SyntheticCountsPropagation()) -MODULE_PASS("unique-internal-linkage-names", UniqueInternalLinkageNamesPass()) -MODULE_PASS("verify", VerifierPass()) -MODULE_PASS("wholeprogramdevirt", WholeProgramDevirtPass()) -MODULE_PASS("dfsan", DataFlowSanitizerPass()) MODULE_PASS("asan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/false, false, true, false)) -MODULE_PASS("msan-module", MemorySanitizerPass({})) -MODULE_PASS("tsan-module", ThreadSanitizerPass()) MODULE_PASS("kasan-module", ModuleAddressSanitizerPass(/*CompileKernel=*/true, false, true, false)) -MODULE_PASS("sancov-module", ModuleSanitizerCoveragePass()) -MODULE_PASS("memprof-module", ModuleMemProfilerPass()) -MODULE_PASS("poison-checking", PoisonCheckingPass()) -MODULE_PASS("pseudo-probe-update", PseudoProbeUpdatePass()) +#undef MODULE_PASS_DEFAULT_NAME #undef MODULE_PASS #ifndef CGSCC_ANALYSIS #define CGSCC_ANALYSIS(NAME, CREATE_PASS) #endif -CGSCC_ANALYSIS("no-op-cgscc", NoOpCGSCCAnalysis()) -CGSCC_ANALYSIS("fam-proxy", FunctionAnalysisManagerCGSCCProxy()) +#define CGSCC_ANALYSIS_DEFAULT_NAME(CREATE_PASS) CGSCC_ANALYSIS(decltype(CREATE_PASS)::name(), CREATE_PASS) +CGSCC_ANALYSIS_DEFAULT_NAME(NoOpCGSCCAnalysis()) +CGSCC_ANALYSIS_DEFAULT_NAME(FunctionAnalysisManagerCGSCCProxy()) CGSCC_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) +#undef CGSCC_ANALYSIS_DEFAULT_NAME #undef CGSCC_ANALYSIS #ifndef CGSCC_PASS #define CGSCC_PASS(NAME, CREATE_PASS) #endif -CGSCC_PASS("argpromotion", ArgumentPromotionPass()) -CGSCC_PASS("invalidate", InvalidateAllAnalysesPass()) -CGSCC_PASS("function-attrs", PostOrderFunctionAttrsPass()) -CGSCC_PASS("attributor-cgscc", AttributorCGSCCPass()) -CGSCC_PASS("inline", InlinerPass()) -CGSCC_PASS("openmpopt", OpenMPOptPass()) -CGSCC_PASS("coro-split", CoroSplitPass()) -CGSCC_PASS("no-op-cgscc", NoOpCGSCCPass()) +#define CGSCC_PASS_DEFAULT_NAME(CREATE_PASS) CGSCC_PASS(decltype(CREATE_PASS)::name(), CREATE_PASS) +CGSCC_PASS_DEFAULT_NAME(ArgumentPromotionPass()) +CGSCC_PASS_DEFAULT_NAME(InvalidateAllAnalysesPass()) +CGSCC_PASS_DEFAULT_NAME(PostOrderFunctionAttrsPass()) +CGSCC_PASS_DEFAULT_NAME(AttributorCGSCCPass()) +CGSCC_PASS_DEFAULT_NAME(InlinerPass()) +CGSCC_PASS_DEFAULT_NAME(OpenMPOptPass()) +CGSCC_PASS_DEFAULT_NAME(CoroSplitPass()) +CGSCC_PASS_DEFAULT_NAME(NoOpCGSCCPass()) +#undef CGSCC_PASS_DEFAULT_NAME #undef CGSCC_PASS #ifndef FUNCTION_ANALYSIS #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) #endif -FUNCTION_ANALYSIS("aa", AAManager()) -FUNCTION_ANALYSIS("assumptions", AssumptionAnalysis()) -FUNCTION_ANALYSIS("block-freq", BlockFrequencyAnalysis()) -FUNCTION_ANALYSIS("branch-prob", BranchProbabilityAnalysis()) -FUNCTION_ANALYSIS("domtree", DominatorTreeAnalysis()) -FUNCTION_ANALYSIS("postdomtree", PostDominatorTreeAnalysis()) -FUNCTION_ANALYSIS("demanded-bits", DemandedBitsAnalysis()) -FUNCTION_ANALYSIS("domfrontier", DominanceFrontierAnalysis()) -FUNCTION_ANALYSIS("func-properties", FunctionPropertiesAnalysis()) -FUNCTION_ANALYSIS("loops", LoopAnalysis()) -FUNCTION_ANALYSIS("lazy-value-info", LazyValueAnalysis()) -FUNCTION_ANALYSIS("da", DependenceAnalysis()) -FUNCTION_ANALYSIS("inliner-size-estimator", InlineSizeEstimatorAnalysis()) -FUNCTION_ANALYSIS("memdep", MemoryDependenceAnalysis()) -FUNCTION_ANALYSIS("memoryssa", MemorySSAAnalysis()) -FUNCTION_ANALYSIS("phi-values", PhiValuesAnalysis()) -FUNCTION_ANALYSIS("regions", RegionInfoAnalysis()) -FUNCTION_ANALYSIS("no-op-function", NoOpFunctionAnalysis()) -FUNCTION_ANALYSIS("opt-remark-emit", OptimizationRemarkEmitterAnalysis()) -FUNCTION_ANALYSIS("scalar-evolution", ScalarEvolutionAnalysis()) -FUNCTION_ANALYSIS("stack-safety-local", StackSafetyAnalysis()) -FUNCTION_ANALYSIS("targetlibinfo", TargetLibraryAnalysis()) +#define FUNCTION_ANALYSIS_DEFAULT_NAME(CREATE_PASS) FUNCTION_ANALYSIS(decltype(CREATE_PASS)::name(), CREATE_PASS) +FUNCTION_ANALYSIS_DEFAULT_NAME(AAManager()) +FUNCTION_ANALYSIS_DEFAULT_NAME(AssumptionAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(BlockFrequencyAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(BranchProbabilityAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(DominatorTreeAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(PostDominatorTreeAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(DemandedBitsAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(DominanceFrontierAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(FunctionPropertiesAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(LoopAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(LazyValueAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(DependenceAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(InlineSizeEstimatorAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(MemoryDependenceAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(MemorySSAAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(PhiValuesAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(RegionInfoAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(NoOpFunctionAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(OptimizationRemarkEmitterAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(ScalarEvolutionAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(StackSafetyAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(TargetLibraryAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(VerifierAnalysis()) +FUNCTION_ANALYSIS_DEFAULT_NAME(DivergenceAnalysis()) FUNCTION_ANALYSIS("targetir", TM ? TM->getTargetIRAnalysis() : TargetIRAnalysis()) -FUNCTION_ANALYSIS("verify", VerifierAnalysis()) FUNCTION_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) -FUNCTION_ANALYSIS("divergence", DivergenceAnalysis()) +#undef FUNCTION_ANALYSIS_DEFAULT_NAME #ifndef FUNCTION_ALIAS_ANALYSIS #define FUNCTION_ALIAS_ANALYSIS(NAME, CREATE_PASS) \ FUNCTION_ANALYSIS(NAME, CREATE_PASS) #endif -FUNCTION_ALIAS_ANALYSIS("basic-aa", BasicAA()) -FUNCTION_ALIAS_ANALYSIS("cfl-anders-aa", CFLAndersAA()) -FUNCTION_ALIAS_ANALYSIS("cfl-steens-aa", CFLSteensAA()) -FUNCTION_ALIAS_ANALYSIS("objc-arc-aa", objcarc::ObjCARCAA()) -FUNCTION_ALIAS_ANALYSIS("scev-aa", SCEVAA()) -FUNCTION_ALIAS_ANALYSIS("scoped-noalias-aa", ScopedNoAliasAA()) -FUNCTION_ALIAS_ANALYSIS("tbaa", TypeBasedAA()) +#define FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(CREATE_PASS) FUNCTION_ALIAS_ANALYSIS(decltype(CREATE_PASS)::name(), CREATE_PASS) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(BasicAA()) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(CFLAndersAA()) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(CFLSteensAA()) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(objcarc::ObjCARCAA()) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(SCEVAA()) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(ScopedNoAliasAA()) +FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME(TypeBasedAA()) +#undef FUNCTION_ALIAS_ANALYSIS_DEFAULT_NAME #undef FUNCTION_ALIAS_ANALYSIS #undef FUNCTION_ANALYSIS #ifndef FUNCTION_PASS #define FUNCTION_PASS(NAME, CREATE_PASS) #endif -FUNCTION_PASS("aa-eval", AAEvaluator()) -FUNCTION_PASS("adce", ADCEPass()) -FUNCTION_PASS("add-discriminators", AddDiscriminatorsPass()) -FUNCTION_PASS("aggressive-instcombine", AggressiveInstCombinePass()) -FUNCTION_PASS("assume-builder", AssumeBuilderPass()) -FUNCTION_PASS("assume-simplify", AssumeSimplifyPass()) -FUNCTION_PASS("alignment-from-assumptions", AlignmentFromAssumptionsPass()) -FUNCTION_PASS("annotation-remarks", AnnotationRemarksPass()) -FUNCTION_PASS("bdce", BDCEPass()) -FUNCTION_PASS("bounds-checking", BoundsCheckingPass()) -FUNCTION_PASS("break-crit-edges", BreakCriticalEdgesPass()) -FUNCTION_PASS("callsite-splitting", CallSiteSplittingPass()) -FUNCTION_PASS("consthoist", ConstantHoistingPass()) -FUNCTION_PASS("constraint-elimination", ConstraintEliminationPass()) -FUNCTION_PASS("chr", ControlHeightReductionPass()) -FUNCTION_PASS("coro-early", CoroEarlyPass()) -FUNCTION_PASS("coro-elide", CoroElidePass()) -FUNCTION_PASS("coro-cleanup", CoroCleanupPass()) -FUNCTION_PASS("correlated-propagation", CorrelatedValuePropagationPass()) -FUNCTION_PASS("dce", DCEPass()) -FUNCTION_PASS("div-rem-pairs", DivRemPairsPass()) -FUNCTION_PASS("dse", DSEPass()) -FUNCTION_PASS("dot-cfg", CFGPrinterPass()) -FUNCTION_PASS("dot-cfg-only", CFGOnlyPrinterPass()) -FUNCTION_PASS("early-cse", EarlyCSEPass(/*UseMemorySSA=*/false)) +#define FUNCTION_PASS_DEFAULT_NAME(CREATE_PASS) FUNCTION_PASS(decltype(CREATE_PASS)::name(), CREATE_PASS) +FUNCTION_PASS_DEFAULT_NAME(AAEvaluator()) +FUNCTION_PASS_DEFAULT_NAME(ADCEPass()) +FUNCTION_PASS_DEFAULT_NAME(AddDiscriminatorsPass()) +FUNCTION_PASS_DEFAULT_NAME(AggressiveInstCombinePass()) +FUNCTION_PASS_DEFAULT_NAME(AssumeBuilderPass()) +FUNCTION_PASS_DEFAULT_NAME(AssumeSimplifyPass()) +FUNCTION_PASS_DEFAULT_NAME(AlignmentFromAssumptionsPass()) +FUNCTION_PASS_DEFAULT_NAME(AnnotationRemarksPass()) +FUNCTION_PASS_DEFAULT_NAME(BDCEPass()) +FUNCTION_PASS_DEFAULT_NAME(BoundsCheckingPass()) +FUNCTION_PASS_DEFAULT_NAME(BreakCriticalEdgesPass()) +FUNCTION_PASS_DEFAULT_NAME(CallSiteSplittingPass()) +FUNCTION_PASS_DEFAULT_NAME(ConstantHoistingPass()) +FUNCTION_PASS_DEFAULT_NAME(ConstraintEliminationPass()) +FUNCTION_PASS_DEFAULT_NAME(ControlHeightReductionPass()) +FUNCTION_PASS_DEFAULT_NAME(CoroEarlyPass()) +FUNCTION_PASS_DEFAULT_NAME(CoroElidePass()) +FUNCTION_PASS_DEFAULT_NAME(CoroCleanupPass()) +FUNCTION_PASS_DEFAULT_NAME(CorrelatedValuePropagationPass()) +FUNCTION_PASS_DEFAULT_NAME(DCEPass()) +FUNCTION_PASS_DEFAULT_NAME(DivRemPairsPass()) +FUNCTION_PASS_DEFAULT_NAME(DSEPass()) +FUNCTION_PASS_DEFAULT_NAME(CFGPrinterPass()) +FUNCTION_PASS_DEFAULT_NAME(CFGOnlyPrinterPass()) +FUNCTION_PASS_DEFAULT_NAME(EarlyCSEPass(/*UseMemorySSA=*/false)) +FUNCTION_PASS_DEFAULT_NAME(EntryExitInstrumenterPass(/*PostInlining=*/false)) +FUNCTION_PASS_DEFAULT_NAME(FixIrreduciblePass()) +FUNCTION_PASS_DEFAULT_NAME(MakeGuardsExplicitPass()) +FUNCTION_PASS_DEFAULT_NAME(GVNHoistPass()) +FUNCTION_PASS_DEFAULT_NAME(GVNSinkPass()) +FUNCTION_PASS_DEFAULT_NAME(HelloWorldPass()) +FUNCTION_PASS_DEFAULT_NAME(InferAddressSpacesPass()) +FUNCTION_PASS_DEFAULT_NAME(InstCombinePass()) +FUNCTION_PASS_DEFAULT_NAME(InstCountPass()) +FUNCTION_PASS_DEFAULT_NAME(InstSimplifyPass()) +FUNCTION_PASS_DEFAULT_NAME(InvalidateAllAnalysesPass()) +FUNCTION_PASS_DEFAULT_NAME(IRCEPass()) +FUNCTION_PASS_DEFAULT_NAME(Float2IntPass()) +FUNCTION_PASS_DEFAULT_NAME(NoOpFunctionPass()) +FUNCTION_PASS_DEFAULT_NAME(LibCallsShrinkWrapPass()) +FUNCTION_PASS_DEFAULT_NAME(LintPass()) +FUNCTION_PASS_DEFAULT_NAME(InjectTLIMappings()) +FUNCTION_PASS_DEFAULT_NAME(InstructionNamerPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerAtomicPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerExpectIntrinsicPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerGuardIntrinsicPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerConstantIntrinsicsPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerMatrixIntrinsicsPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerWidenableConditionPass()) +FUNCTION_PASS_DEFAULT_NAME(GuardWideningPass()) +FUNCTION_PASS_DEFAULT_NAME(LoadStoreVectorizerPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopSimplifyPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopSinkPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopUnrollAndJamPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopFlattenPass()) +FUNCTION_PASS_DEFAULT_NAME(LowerInvokePass()) +FUNCTION_PASS_DEFAULT_NAME(LowerSwitchPass()) +FUNCTION_PASS_DEFAULT_NAME(PromotePass()) +FUNCTION_PASS_DEFAULT_NAME(MemCpyOptPass()) +FUNCTION_PASS_DEFAULT_NAME(MergeICmpsPass()) +FUNCTION_PASS_DEFAULT_NAME(UnifyFunctionExitNodesPass()) +FUNCTION_PASS_DEFAULT_NAME(NaryReassociatePass()) +FUNCTION_PASS_DEFAULT_NAME(NewGVNPass()) +FUNCTION_PASS_DEFAULT_NAME(JumpThreadingPass()) +FUNCTION_PASS_DEFAULT_NAME(PartiallyInlineLibCallsPass()) +FUNCTION_PASS_DEFAULT_NAME(LCSSAPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopDataPrefetchPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopLoadEliminationPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopFusePass()) +FUNCTION_PASS_DEFAULT_NAME(LoopDistributePass()) +FUNCTION_PASS_DEFAULT_NAME(LoopVersioningPass()) +FUNCTION_PASS_DEFAULT_NAME(ObjCARCOptPass()) +FUNCTION_PASS_DEFAULT_NAME(ObjCARCContractPass()) +FUNCTION_PASS_DEFAULT_NAME(ObjCARCExpandPass()) +FUNCTION_PASS_DEFAULT_NAME(PGOMemOPSizeOpt()) +FUNCTION_PASS_DEFAULT_NAME(ReassociatePass()) +FUNCTION_PASS_DEFAULT_NAME(RedundantDbgInstEliminationPass()) +FUNCTION_PASS_DEFAULT_NAME(RegToMemPass()) +FUNCTION_PASS_DEFAULT_NAME(ScalarizeMaskedMemIntrinPass()) +FUNCTION_PASS_DEFAULT_NAME(ScalarizerPass()) +FUNCTION_PASS_DEFAULT_NAME(SeparateConstOffsetFromGEPPass()) +FUNCTION_PASS_DEFAULT_NAME(SCCPPass()) +FUNCTION_PASS_DEFAULT_NAME(SimplifyCFGPass()) +FUNCTION_PASS_DEFAULT_NAME(SinkingPass()) +FUNCTION_PASS_DEFAULT_NAME(SLPVectorizerPass()) +FUNCTION_PASS_DEFAULT_NAME(StraightLineStrengthReducePass()) +FUNCTION_PASS_DEFAULT_NAME(SpeculativeExecutionPass()) +FUNCTION_PASS_DEFAULT_NAME(SpeculateAroundPHIsPass()) +FUNCTION_PASS_DEFAULT_NAME(SROA()) +FUNCTION_PASS_DEFAULT_NAME(StripGCRelocates()) +FUNCTION_PASS_DEFAULT_NAME(StructurizeCFGPass()) +FUNCTION_PASS_DEFAULT_NAME(TailCallElimPass()) +FUNCTION_PASS_DEFAULT_NAME(UnifyLoopExitsPass()) +FUNCTION_PASS_DEFAULT_NAME(VectorCombinePass()) +FUNCTION_PASS_DEFAULT_NAME(VerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(DominatorTreeVerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(LoopVerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(MemorySSAVerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(RegionInfoVerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(SafepointIRVerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(ScalarEvolutionVerifierPass()) +FUNCTION_PASS_DEFAULT_NAME(CFGViewerPass()) +FUNCTION_PASS_DEFAULT_NAME(CFGOnlyViewerPass()) +FUNCTION_PASS_DEFAULT_NAME(WarnMissedTransformationsPass()) +FUNCTION_PASS_DEFAULT_NAME(AddressSanitizerPass(false, false, false)) +FUNCTION_PASS_DEFAULT_NAME(MemorySanitizerPass({})) +FUNCTION_PASS_DEFAULT_NAME(ThreadSanitizerPass()) +FUNCTION_PASS_DEFAULT_NAME(MemProfilerPass()) FUNCTION_PASS("early-cse-memssa", EarlyCSEPass(/*UseMemorySSA=*/true)) -FUNCTION_PASS("ee-instrument", EntryExitInstrumenterPass(/*PostInlining=*/false)) -FUNCTION_PASS("fix-irreducible", FixIrreduciblePass()) -FUNCTION_PASS("make-guards-explicit", MakeGuardsExplicitPass()) FUNCTION_PASS("post-inline-ee-instrument", EntryExitInstrumenterPass(/*PostInlining=*/true)) -FUNCTION_PASS("gvn-hoist", GVNHoistPass()) -FUNCTION_PASS("gvn-sink", GVNSinkPass()) -FUNCTION_PASS("helloworld", HelloWorldPass()) -FUNCTION_PASS("infer-address-spaces", InferAddressSpacesPass()) -FUNCTION_PASS("instcombine", InstCombinePass()) -FUNCTION_PASS("instcount", InstCountPass()) -FUNCTION_PASS("instsimplify", InstSimplifyPass()) -FUNCTION_PASS("invalidate", InvalidateAllAnalysesPass()) -FUNCTION_PASS("irce", IRCEPass()) -FUNCTION_PASS("float2int", Float2IntPass()) -FUNCTION_PASS("no-op-function", NoOpFunctionPass()) -FUNCTION_PASS("libcalls-shrinkwrap", LibCallsShrinkWrapPass()) -FUNCTION_PASS("lint", LintPass()) -FUNCTION_PASS("inject-tli-mappings", InjectTLIMappings()) -FUNCTION_PASS("instnamer", InstructionNamerPass()) -FUNCTION_PASS("loweratomic", LowerAtomicPass()) -FUNCTION_PASS("lower-expect", LowerExpectIntrinsicPass()) -FUNCTION_PASS("lower-guard-intrinsic", LowerGuardIntrinsicPass()) -FUNCTION_PASS("lower-constant-intrinsics", LowerConstantIntrinsicsPass()) -FUNCTION_PASS("lower-matrix-intrinsics", LowerMatrixIntrinsicsPass()) FUNCTION_PASS("lower-matrix-intrinsics-minimal", LowerMatrixIntrinsicsPass(true)) -FUNCTION_PASS("lower-widenable-condition", LowerWidenableConditionPass()) -FUNCTION_PASS("guard-widening", GuardWideningPass()) -FUNCTION_PASS("load-store-vectorizer", LoadStoreVectorizerPass()) -FUNCTION_PASS("loop-simplify", LoopSimplifyPass()) -FUNCTION_PASS("loop-sink", LoopSinkPass()) -FUNCTION_PASS("loop-unroll-and-jam", LoopUnrollAndJamPass()) -FUNCTION_PASS("loop-flatten", LoopFlattenPass()) -FUNCTION_PASS("lowerinvoke", LowerInvokePass()) -FUNCTION_PASS("lowerswitch", LowerSwitchPass()) -FUNCTION_PASS("mem2reg", PromotePass()) -FUNCTION_PASS("memcpyopt", MemCpyOptPass()) -FUNCTION_PASS("mergeicmps", MergeICmpsPass()) -FUNCTION_PASS("mergereturn", UnifyFunctionExitNodesPass()) -FUNCTION_PASS("nary-reassociate", NaryReassociatePass()) -FUNCTION_PASS("newgvn", NewGVNPass()) -FUNCTION_PASS("jump-threading", JumpThreadingPass()) -FUNCTION_PASS("partially-inline-libcalls", PartiallyInlineLibCallsPass()) -FUNCTION_PASS("lcssa", LCSSAPass()) -FUNCTION_PASS("loop-data-prefetch", LoopDataPrefetchPass()) -FUNCTION_PASS("loop-load-elim", LoopLoadEliminationPass()) -FUNCTION_PASS("loop-fusion", LoopFusePass()) -FUNCTION_PASS("loop-distribute", LoopDistributePass()) -FUNCTION_PASS("loop-versioning", LoopVersioningPass()) -FUNCTION_PASS("objc-arc", ObjCARCOptPass()) -FUNCTION_PASS("objc-arc-contract", ObjCARCContractPass()) -FUNCTION_PASS("objc-arc-expand", ObjCARCExpandPass()) -FUNCTION_PASS("pgo-memop-opt", PGOMemOPSizeOpt()) FUNCTION_PASS("print", PrintFunctionPass(dbgs())) FUNCTION_PASS("print", AssumptionPrinterPass(dbgs())) FUNCTION_PASS("print", BlockFrequencyPrinterPass(dbgs())) @@ -295,41 +342,9 @@ FUNCTION_PASS("print-predicateinfo", PredicateInfoPrinterPass(dbgs())) FUNCTION_PASS("print-mustexecute", MustExecutePrinterPass(dbgs())) FUNCTION_PASS("print-memderefs", MemDerefPrinterPass(dbgs())) -FUNCTION_PASS("reassociate", ReassociatePass()) -FUNCTION_PASS("redundant-dbg-inst-elim", RedundantDbgInstEliminationPass()) -FUNCTION_PASS("reg2mem", RegToMemPass()) -FUNCTION_PASS("scalarize-masked-mem-intrin", ScalarizeMaskedMemIntrinPass()) -FUNCTION_PASS("scalarizer", ScalarizerPass()) -FUNCTION_PASS("separate-const-offset-from-gep", SeparateConstOffsetFromGEPPass()) -FUNCTION_PASS("sccp", SCCPPass()) -FUNCTION_PASS("simplifycfg", SimplifyCFGPass()) -FUNCTION_PASS("sink", SinkingPass()) -FUNCTION_PASS("slp-vectorizer", SLPVectorizerPass()) -FUNCTION_PASS("slsr", StraightLineStrengthReducePass()) -FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass()) -FUNCTION_PASS("spec-phis", SpeculateAroundPHIsPass()) -FUNCTION_PASS("sroa", SROA()) -FUNCTION_PASS("strip-gc-relocates", StripGCRelocates()) -FUNCTION_PASS("structurizecfg", StructurizeCFGPass()) -FUNCTION_PASS("tailcallelim", TailCallElimPass()) -FUNCTION_PASS("unify-loop-exits", UnifyLoopExitsPass()) -FUNCTION_PASS("vector-combine", VectorCombinePass()) -FUNCTION_PASS("verify", VerifierPass()) -FUNCTION_PASS("verify", DominatorTreeVerifierPass()) -FUNCTION_PASS("verify", LoopVerifierPass()) -FUNCTION_PASS("verify", MemorySSAVerifierPass()) -FUNCTION_PASS("verify", RegionInfoVerifierPass()) -FUNCTION_PASS("verify", SafepointIRVerifierPass()) -FUNCTION_PASS("verify", ScalarEvolutionVerifierPass()) -FUNCTION_PASS("view-cfg", CFGViewerPass()) -FUNCTION_PASS("view-cfg-only", CFGOnlyViewerPass()) -FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass()) -FUNCTION_PASS("asan", AddressSanitizerPass(false, false, false)) FUNCTION_PASS("kasan", AddressSanitizerPass(true, false, false)) -FUNCTION_PASS("msan", MemorySanitizerPass({})) FUNCTION_PASS("kmsan", MemorySanitizerPass({0, false, /*Kernel=*/true})) -FUNCTION_PASS("tsan", ThreadSanitizerPass()) -FUNCTION_PASS("memprof", MemProfilerPass()) +#undef FUNCTION_PASS_DEFAULT_NAME #undef FUNCTION_PASS #ifndef FUNCTION_PASS_WITH_PARAMS @@ -375,41 +390,45 @@ #ifndef LOOP_ANALYSIS #define LOOP_ANALYSIS(NAME, CREATE_PASS) #endif -LOOP_ANALYSIS("no-op-loop", NoOpLoopAnalysis()) -LOOP_ANALYSIS("access-info", LoopAccessAnalysis()) -LOOP_ANALYSIS("ddg", DDGAnalysis()) -LOOP_ANALYSIS("iv-users", IVUsersAnalysis()) +#define LOOP_ANALYSIS_DEFAULT_NAME(CREATE_PASS) LOOP_ANALYSIS(decltype(CREATE_PASS)::name(), CREATE_PASS) +LOOP_ANALYSIS_DEFAULT_NAME(NoOpLoopAnalysis()) +LOOP_ANALYSIS_DEFAULT_NAME(LoopAccessAnalysis()) +LOOP_ANALYSIS_DEFAULT_NAME(DDGAnalysis()) +LOOP_ANALYSIS_DEFAULT_NAME(IVUsersAnalysis()) LOOP_ANALYSIS("pass-instrumentation", PassInstrumentationAnalysis(PIC)) +#undef LOOP_ANALYSIS_DEFAULT_NAME #undef LOOP_ANALYSIS #ifndef LOOP_PASS #define LOOP_PASS(NAME, CREATE_PASS) #endif -LOOP_PASS("canon-freeze", CanonicalizeFreezeInLoopsPass()) -LOOP_PASS("dot-ddg", DDGDotPrinterPass()) -LOOP_PASS("invalidate", InvalidateAllAnalysesPass()) -LOOP_PASS("licm", LICMPass()) -LOOP_PASS("loop-idiom", LoopIdiomRecognizePass()) -LOOP_PASS("loop-instsimplify", LoopInstSimplifyPass()) -LOOP_PASS("loop-interchange", LoopInterchangePass()) -LOOP_PASS("loop-rotate", LoopRotatePass()) -LOOP_PASS("no-op-loop", NoOpLoopPass()) +#define LOOP_PASS_DEFAULT_NAME(CREATE_PASS) LOOP_PASS(decltype(CREATE_PASS)::name(), CREATE_PASS) +LOOP_PASS_DEFAULT_NAME(CanonicalizeFreezeInLoopsPass()) +LOOP_PASS_DEFAULT_NAME(DDGDotPrinterPass()) +LOOP_PASS_DEFAULT_NAME(InvalidateAllAnalysesPass()) +LOOP_PASS_DEFAULT_NAME(LICMPass()) +LOOP_PASS_DEFAULT_NAME(LoopIdiomRecognizePass()) +LOOP_PASS_DEFAULT_NAME(LoopInstSimplifyPass()) +LOOP_PASS_DEFAULT_NAME(LoopInterchangePass()) +LOOP_PASS_DEFAULT_NAME(LoopRotatePass()) +LOOP_PASS_DEFAULT_NAME(NoOpLoopPass()) +LOOP_PASS_DEFAULT_NAME(LoopDeletionPass()) +LOOP_PASS_DEFAULT_NAME(LoopSimplifyCFGPass()) +LOOP_PASS_DEFAULT_NAME(LoopStrengthReducePass()) +LOOP_PASS_DEFAULT_NAME(IndVarSimplifyPass()) +LOOP_PASS_DEFAULT_NAME(LoopFullUnrollPass()) +LOOP_PASS_DEFAULT_NAME(LoopPredicationPass()) +LOOP_PASS_DEFAULT_NAME(GuardWideningPass()) +LOOP_PASS_DEFAULT_NAME(SimpleLoopUnswitchPass()) +LOOP_PASS_DEFAULT_NAME(LoopRerollPass()) +LOOP_PASS_DEFAULT_NAME(LoopVersioningLICMPass()) LOOP_PASS("print", PrintLoopPass(dbgs())) -LOOP_PASS("loop-deletion", LoopDeletionPass()) -LOOP_PASS("loop-simplifycfg", LoopSimplifyCFGPass()) -LOOP_PASS("loop-reduce", LoopStrengthReducePass()) -LOOP_PASS("indvars", IndVarSimplifyPass()) -LOOP_PASS("loop-unroll-full", LoopFullUnrollPass()) LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs())) LOOP_PASS("print", DDGAnalysisPrinterPass(dbgs())) LOOP_PASS("print", IVUsersPrinterPass(dbgs())) LOOP_PASS("print", LoopNestPrinterPass(dbgs())) LOOP_PASS("print", LoopCachePrinterPass(dbgs())) -LOOP_PASS("loop-predication", LoopPredicationPass()) -LOOP_PASS("guard-widening", GuardWideningPass()) -LOOP_PASS("simple-loop-unswitch", SimpleLoopUnswitchPass()) -LOOP_PASS("loop-reroll", LoopRerollPass()) -LOOP_PASS("loop-versioning-licm", LoopVersioningLICMPass()) +#undef LOOP_PASS_DEFAULT_NAME #undef LOOP_PASS #ifndef LOOP_PASS_WITH_PARAMS diff --git a/llvm/lib/Passes/StandardInstrumentations.cpp b/llvm/lib/Passes/StandardInstrumentations.cpp --- a/llvm/lib/Passes/StandardInstrumentations.cpp +++ b/llvm/lib/Passes/StandardInstrumentations.cpp @@ -756,8 +756,7 @@ } void PrintIRInstrumentation::printAfterPassInvalidated(StringRef PassID) { - StringRef PassName = PIC->getPassNameForClassName(PassID); - if (!StoreModuleDesc || !shouldPrintAfterPass(PassName)) + if (!StoreModuleDesc || !shouldPrintAfterPass(PassID)) return; if (isIgnored(PassID)) @@ -781,16 +780,14 @@ if (shouldPrintBeforeAll()) return true; - StringRef PassName = PIC->getPassNameForClassName(PassID); - return llvm::is_contained(printBeforePasses(), PassName); + return llvm::is_contained(printBeforePasses(), PassID); } bool PrintIRInstrumentation::shouldPrintAfterPass(StringRef PassID) { if (shouldPrintAfterAll()) return true; - StringRef PassName = PIC->getPassNameForClassName(PassID); - return llvm::is_contained(printAfterPasses(), PassName); + return llvm::is_contained(printAfterPasses(), PassID); } void PrintIRInstrumentation::registerCallbacks( diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.h b/llvm/lib/Target/AMDGPU/AMDGPU.h --- a/llvm/lib/Target/AMDGPU/AMDGPU.h +++ b/llvm/lib/Target/AMDGPU/AMDGPU.h @@ -76,6 +76,7 @@ struct AMDGPUSimplifyLibCallsPass : PassInfoMixin { AMDGPUSimplifyLibCallsPass(TargetMachine &TM) : TM(TM) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "amdgpu-simplifylib"; } private: TargetMachine &TM; @@ -83,6 +84,7 @@ struct AMDGPUUseNativeCallsPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "amdgpu-usenative"; } }; void initializeAMDGPUDAGToDAGISelPass(PassRegistry&); @@ -119,6 +121,7 @@ struct AMDGPULowerKernelAttributesPass : PassInfoMixin { PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "amdgpu-lower-kernel-attributes"; } }; void initializeAMDGPUPropagateAttributesEarlyPass(PassRegistry &); @@ -128,6 +131,7 @@ : PassInfoMixin { AMDGPUPropagateAttributesEarlyPass(TargetMachine &TM) : TM(TM) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "amdgpu-propagate-attributes-early"; } private: TargetMachine &TM; @@ -140,6 +144,7 @@ : PassInfoMixin { AMDGPUPropagateAttributesLatePass(TargetMachine &TM) : TM(TM) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "amdgpu-propagate-attributes-late"; } private: TargetMachine &TM; @@ -235,6 +240,7 @@ struct AMDGPUPromoteAllocaPass : PassInfoMixin { AMDGPUPromoteAllocaPass(TargetMachine &TM) : TM(TM) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "amdgpu-promote-alloca"; } private: TargetMachine &TM; @@ -244,6 +250,7 @@ : PassInfoMixin { AMDGPUPromoteAllocaToVectorPass(TargetMachine &TM) : TM(TM) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "amdgpu-promote-alloca-to-vector"; } private: TargetMachine &TM; @@ -258,6 +265,7 @@ struct AMDGPUAlwaysInlinePass : PassInfoMixin { AMDGPUAlwaysInlinePass(bool GlobalOpt = true) : GlobalOpt(GlobalOpt) {} PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "amdgpu-always-inline"; } private: bool GlobalOpt; @@ -273,6 +281,7 @@ struct AMDGPUPrintfRuntimeBindingPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "amdgpu-printf-runtime-binding"; } }; ModulePass* createAMDGPUUnifyMetadataPass(); @@ -281,6 +290,7 @@ struct AMDGPUUnifyMetadataPass : PassInfoMixin { PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "amdgpu-unify-metadata"; } }; void initializeSIOptimizeExecMaskingPreRAPass(PassRegistry&); diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h --- a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h @@ -58,6 +58,8 @@ AMDGPUAAResult run(Function &F, AnalysisManager &AM) { return AMDGPUAAResult(F.getParent()->getDataLayout()); } + + static StringRef name() { return "amdgpu-aa"; } }; /// Legacy wrapper pass to provide the AMDGPUAAResult object. diff --git a/llvm/lib/Target/BPF/BPF.h b/llvm/lib/Target/BPF/BPF.h --- a/llvm/lib/Target/BPF/BPF.h +++ b/llvm/lib/Target/BPF/BPF.h @@ -48,6 +48,7 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "bpf-abstract-member-access"; } }; class BPFPreserveDITypePass : public PassInfoMixin { @@ -55,11 +56,13 @@ PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); static bool isRequired() { return true; } + static StringRef name() { return "bpf-preserve-di-type"; } }; class BPFAdjustOptPass : public PassInfoMixin { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); + static StringRef name() { return "bpf-adjust-opt"; } }; } // namespace llvm diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.h b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.h --- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.h +++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.h @@ -18,6 +18,7 @@ : PassInfoMixin { PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "hexagon-loop-idiom"; } }; } // namespace llvm diff --git a/llvm/lib/Target/Hexagon/HexagonVectorLoopCarriedReuse.h b/llvm/lib/Target/Hexagon/HexagonVectorLoopCarriedReuse.h --- a/llvm/lib/Target/Hexagon/HexagonVectorLoopCarriedReuse.h +++ b/llvm/lib/Target/Hexagon/HexagonVectorLoopCarriedReuse.h @@ -132,6 +132,7 @@ /// Run pass over the Loop. PreservedAnalyses run(Loop &L, LoopAnalysisManager &LAM, LoopStandardAnalysisResults &AR, LPMUpdater &U); + static StringRef name() { return "hexagon-vlcr"; } }; } // end namespace llvm diff --git a/llvm/lib/Target/NVPTX/NVPTX.h b/llvm/lib/Target/NVPTX/NVPTX.h --- a/llvm/lib/Target/NVPTX/NVPTX.h +++ b/llvm/lib/Target/NVPTX/NVPTX.h @@ -52,6 +52,7 @@ NVVMIntrRangePass(); NVVMIntrRangePass(unsigned SmVersion) : SmVersion(SmVersion) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "nvvm-intr-range"; } private: unsigned SmVersion; @@ -61,6 +62,7 @@ NVVMReflectPass(); NVVMReflectPass(unsigned SmVersion) : SmVersion(SmVersion) {} PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM); + static StringRef name() { return "nvvm-reflect"; } private: unsigned SmVersion;