[llvm] r225346 - [PM] Give slightly less horrible names to the utility pass templates for
Duncan P. N. Exon Smith
dexonsmith at apple.com
Thu Jan 8 11:12:11 PST 2015
> On 2015-Jan-07, at 03:14, Chandler Carruth <chandlerc at gmail.com> wrote:
>
> Author: chandlerc
> Date: Wed Jan 7 05:14:51 2015
> New Revision: 225346
>
> URL: http://llvm.org/viewvc/llvm-project?rev=225346&view=rev
> Log:
> [PM] Give slightly less horrible names to the utility pass templates for
> requiring and invalidating specific analyses. Also make their printed
> names match their class names. Writing these out as prose really doesn't
> make sense to me any more.
This looks better to me too. I think the prose gets in the way, and
makes the output unnecessarily awkward to deal with in scripts.
> Modified:
> llvm/trunk/include/llvm/IR/PassManager.h
> llvm/trunk/test/Other/new-pass-manager.ll
> llvm/trunk/tools/opt/Passes.cpp
>
> Modified: llvm/trunk/include/llvm/IR/PassManager.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=225346&r1=225345&r2=225346&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/IR/PassManager.h (original)
> +++ llvm/trunk/include/llvm/IR/PassManager.h Wed Jan 7 05:14:51 2015
> @@ -781,7 +781,7 @@ createModuleToFunctionPassAdaptor(Functi
> ///
> /// This is a no-op pass which simply forces a specific analysis pass's result
> /// to be available when it is run.
> -template <typename AnalysisT> struct NoopAnalysisRequirementPass {
> +template <typename AnalysisT> struct RequireAnalysisPass {
> /// \brief Run this pass over some unit of IR.
> ///
> /// This pass can be run over any unit of IR and use any analysis manager
> @@ -796,7 +796,7 @@ template <typename AnalysisT> struct Noo
> return PreservedAnalyses::all();
> }
>
> - static StringRef name() { return "No-op Analysis Requirement Pass"; }
> + static StringRef name() { return "RequireAnalysisPass"; }
> };
>
> /// \brief A template utility pass to force an analysis result to be
> @@ -804,7 +804,7 @@ template <typename AnalysisT> struct Noo
> ///
> /// This is a no-op pass which simply forces a specific analysis result to be
> /// invalidated when it is run.
> -template <typename AnalysisT> struct NoopAnalysisInvalidationPass {
> +template <typename AnalysisT> struct InvalidateAnalysisPass {
> /// \brief Run this pass over some unit of IR.
> ///
> /// This pass can be run over any unit of IR and use any analysis manager
> @@ -821,7 +821,7 @@ template <typename AnalysisT> struct Noo
> return PreservedAnalyses::all();
> }
>
> - static StringRef name() { return "No-op Analysis Invalidation Pass"; }
> + static StringRef name() { return "InvalidateAnalysisPass"; }
> };
>
> /// \brief A utility pass that does nothing but preserves no analyses.
>
> Modified: llvm/trunk/test/Other/new-pass-manager.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/new-pass-manager.ll?rev=225346&r1=225345&r2=225346&view=diff
> ==============================================================================
> --- llvm/trunk/test/Other/new-pass-manager.ll (original)
> +++ llvm/trunk/test/Other/new-pass-manager.ll Wed Jan 7 05:14:51 2015
> @@ -126,13 +126,13 @@
> ; RUN: -passes='require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>))' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-ANALYSES
> ; CHECK-ANALYSES: Starting module pass manager
> -; CHECK-ANALYSES: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-ANALYSES: Running module pass: RequireAnalysisPass
> ; CHECK-ANALYSES: Running module analysis: NoOpModuleAnalysis
> ; CHECK-ANALYSES: Starting CGSCC pass manager
> -; CHECK-ANALYSES: Running CGSCC pass: No-op Analysis Requirement Pass
> +; CHECK-ANALYSES: Running CGSCC pass: RequireAnalysisPass
> ; CHECK-ANALYSES: Running CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-ANALYSES: Starting function pass manager
> -; CHECK-ANALYSES: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-ANALYSES: Running function pass: RequireAnalysisPass
> ; CHECK-ANALYSES: Running function analysis: NoOpFunctionAnalysis
>
> ; Make sure no-op passes that preserve all analyses don't even try to do any
> @@ -147,7 +147,7 @@
> ; RUN: -passes='require<no-op-module>,require<no-op-module>,require<no-op-module>' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS
> ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Starting module pass manager
> -; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running module pass: RequireAnalysisPass
> ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS: Running module analysis: NoOpModuleAnalysis
> ; CHECK-DO-CACHE-MODULE-ANALYSIS-RESULTS-NOT: Running module analysis: NoOpModuleAnalysis
>
> @@ -155,7 +155,7 @@
> ; RUN: -passes='require<no-op-module>,invalidate<no-op-module>,require<no-op-module>' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS
> ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Starting module pass manager
> -; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module pass: RequireAnalysisPass
> ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module analysis: NoOpModuleAnalysis
> ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Invalidating module analysis: NoOpModuleAnalysis
> ; CHECK-DO-INVALIDATE-MODULE-ANALYSIS-RESULTS: Running module analysis: NoOpModuleAnalysis
> @@ -164,7 +164,7 @@
> ; RUN: -passes='cgscc(require<no-op-cgscc>,require<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS
> ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Starting CGSCC pass manager
> -; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: No-op Analysis Requirement Pass
> +; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: RequireAnalysisPass
> ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS: Running CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-DO-CACHE-CGSCC-ANALYSIS-RESULTS-NOT: Running CGSCC analysis: NoOpCGSCCAnalysis
>
> @@ -172,7 +172,7 @@
> ; RUN: -passes='cgscc(require<no-op-cgscc>,invalidate<no-op-cgscc>,require<no-op-cgscc>)' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS
> ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Starting CGSCC pass manager
> -; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: No-op Analysis Requirement Pass
> +; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC pass: RequireAnalysisPass
> ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Invalidating CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-DO-INVALIDATE-CGSCC-ANALYSIS-RESULTS: Running CGSCC analysis: NoOpCGSCCAnalysis
> @@ -181,7 +181,7 @@
> ; RUN: -passes='function(require<no-op-function>,require<no-op-function>,require<no-op-function>)' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS
> ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Starting function pass manager
> -; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running function pass: RequireAnalysisPass
> ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-DO-CACHE-FUNCTION-ANALYSIS-RESULTS-NOT: Running function analysis: NoOpFunctionAnalysis
>
> @@ -189,7 +189,7 @@
> ; RUN: -passes='function(require<no-op-function>,invalidate<no-op-function>,require<no-op-function>)' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS
> ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Starting function pass manager
> -; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function pass: RequireAnalysisPass
> ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Invalidating function analysis: NoOpFunctionAnalysis
> ; CHECK-DO-INVALIDATE-FUNCTION-ANALYSIS-RESULTS: Running function analysis: NoOpFunctionAnalysis
> @@ -198,30 +198,30 @@
> ; RUN: -passes='require<no-op-module>,module(require<no-op-module>,function(require<no-op-function>,invalidate<all>,require<no-op-function>),require<no-op-module>),require<no-op-module>' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL
> ; CHECK-INVALIDATE-ALL: Starting module pass manager run.
> -; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL: Starting module pass manager run.
> -; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-NOT: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL: Starting function pass manager run.
> -; CHECK-INVALIDATE-ALL: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL: Running function pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-INVALIDATE-ALL: Running function pass: InvalidateAllAnalysesPass
> ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for function
> ; CHECK-INVALIDATE-ALL: Invalidating function analysis: NoOpFunctionAnalysis
> -; CHECK-INVALIDATE-ALL: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL: Running function pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-INVALIDATE-ALL: Finished function pass manager run.
> ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for function
> ; CHECK-INVALIDATE-ALL-NOT: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for module
> ; CHECK-INVALIDATE-ALL: Invalidating module analysis: NoOpModuleAnalysis
> -; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL: Finished module pass manager run.
> ; CHECK-INVALIDATE-ALL: Invalidating all non-preserved analyses for module
> ; CHECK-INVALIDATE-ALL-NOT: Invalidating module analysis: NoOpModuleAnalysis
> -; CHECK-INVALIDATE-ALL: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-NOT: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL: Finished module pass manager run.
>
> @@ -229,40 +229,40 @@
> ; RUN: -passes='require<no-op-module>,module(require<no-op-module>,cgscc(require<no-op-cgscc>,function(require<no-op-function>,invalidate<all>,require<no-op-function>),require<no-op-cgscc>),require<no-op-module>),require<no-op-module>' %s 2>&1 \
> ; RUN: | FileCheck %s --check-prefix=CHECK-INVALIDATE-ALL-CG
> ; CHECK-INVALIDATE-ALL-CG: Starting module pass manager run.
> -; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Starting module pass manager run.
> -; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG-NOT: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Starting CGSCC pass manager run.
> -; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG: Running CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Starting function pass manager run.
> -; CHECK-INVALIDATE-ALL-CG: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running function pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Running function pass: InvalidateAllAnalysesPass
> ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for function
> ; CHECK-INVALIDATE-ALL-CG: Invalidating function analysis: NoOpFunctionAnalysis
> -; CHECK-INVALIDATE-ALL-CG: Running function pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running function pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Finished function pass manager run.
> ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for function
> ; CHECK-INVALIDATE-ALL-CG-NOT: Running function analysis: NoOpFunctionAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for SCC
> ; CHECK-INVALIDATE-ALL-CG: Invalidating CGSCC analysis: NoOpCGSCCAnalysis
> -; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running CGSCC pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG: Running CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Finished CGSCC pass manager run.
> ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for SCC
> ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating CGSCC analysis: NoOpCGSCCAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for module
> ; CHECK-INVALIDATE-ALL-CG: Invalidating module analysis: NoOpModuleAnalysis
> -; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Finished module pass manager run.
> ; CHECK-INVALIDATE-ALL-CG: Invalidating all non-preserved analyses for module
> ; CHECK-INVALIDATE-ALL-CG-NOT: Invalidating module analysis: NoOpModuleAnalysis
> -; CHECK-INVALIDATE-ALL-CG: Running module pass: No-op Analysis Requirement Pass
> +; CHECK-INVALIDATE-ALL-CG: Running module pass: RequireAnalysisPass
> ; CHECK-INVALIDATE-ALL-CG-NOT: Running module analysis: NoOpModuleAnalysis
> ; CHECK-INVALIDATE-ALL-CG: Finished module pass manager run.
>
>
> Modified: llvm/trunk/tools/opt/Passes.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/Passes.cpp?rev=225346&r1=225345&r2=225346&view=diff
> ==============================================================================
> --- llvm/trunk/tools/opt/Passes.cpp (original)
> +++ llvm/trunk/tools/opt/Passes.cpp Wed Jan 7 05:14:51 2015
> @@ -142,11 +142,11 @@ static bool parseModulePassName(ModulePa
> }
> #define MODULE_ANALYSIS(NAME, CREATE_PASS) \
> if (Name == "require<" NAME ">") { \
> - MPM.addPass(NoopAnalysisRequirementPass<decltype(CREATE_PASS)>()); \
> + MPM.addPass(RequireAnalysisPass<decltype(CREATE_PASS)>()); \
> return true; \
> } \
> if (Name == "invalidate<" NAME ">") { \
> - MPM.addPass(NoopAnalysisInvalidationPass<decltype(CREATE_PASS)>()); \
> + MPM.addPass(InvalidateAnalysisPass<decltype(CREATE_PASS)>()); \
> return true; \
> }
> #include "PassRegistry.def"
> @@ -162,11 +162,11 @@ static bool parseCGSCCPassName(CGSCCPass
> }
> #define CGSCC_ANALYSIS(NAME, CREATE_PASS) \
> if (Name == "require<" NAME ">") { \
> - CGPM.addPass(NoopAnalysisRequirementPass<decltype(CREATE_PASS)>()); \
> + CGPM.addPass(RequireAnalysisPass<decltype(CREATE_PASS)>()); \
> return true; \
> } \
> if (Name == "invalidate<" NAME ">") { \
> - CGPM.addPass(NoopAnalysisInvalidationPass<decltype(CREATE_PASS)>()); \
> + CGPM.addPass(InvalidateAnalysisPass<decltype(CREATE_PASS)>()); \
> return true; \
> }
> #include "PassRegistry.def"
> @@ -182,11 +182,11 @@ static bool parseFunctionPassName(Functi
> }
> #define FUNCTION_ANALYSIS(NAME, CREATE_PASS) \
> if (Name == "require<" NAME ">") { \
> - FPM.addPass(NoopAnalysisRequirementPass<decltype(CREATE_PASS)>()); \
> + FPM.addPass(RequireAnalysisPass<decltype(CREATE_PASS)>()); \
> return true; \
> } \
> if (Name == "invalidate<" NAME ">") { \
> - FPM.addPass(NoopAnalysisInvalidationPass<decltype(CREATE_PASS)>()); \
> + FPM.addPass(InvalidateAnalysisPass<decltype(CREATE_PASS)>()); \
> return true; \
> }
> #include "PassRegistry.def"
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list