[llvm] r277689 - [PM] Change the name of the repeating utility to something less

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 20:52:53 PDT 2016


Author: chandlerc
Date: Wed Aug  3 22:52:53 2016
New Revision: 277689

URL: http://llvm.org/viewvc/llvm-project?rev=277689&view=rev
Log:
[PM] Change the name of the repeating utility to something less
overloaded (and simpler).

Sean rightly pointed out in code review that we've started using
"wrapper pass" as a specific part of the old pass manager, and in fact
it is more applicable there. Here, we really have a pass *template* to
build a repeated pass, so call it that.

Modified:
    llvm/trunk/include/llvm/IR/PassManager.h
    llvm/trunk/lib/Passes/PassBuilder.cpp
    llvm/trunk/test/Other/new-pass-manager.ll

Modified: llvm/trunk/include/llvm/IR/PassManager.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/PassManager.h?rev=277689&r1=277688&r2=277689&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/PassManager.h (original)
+++ llvm/trunk/include/llvm/IR/PassManager.h Wed Aug  3 22:52:53 2016
@@ -992,21 +992,19 @@ struct InvalidateAllAnalysesPass : PassI
 /// This can be useful when debugging or testing passes. It also serves as an
 /// example of how to extend the pass manager in ways beyond composition.
 template <typename PassT>
-class RepeatingPassWrapper : public PassInfoMixin<RepeatingPassWrapper<PassT>> {
+class RepeatedPass : public PassInfoMixin<RepeatedPass<PassT>> {
 public:
-  RepeatingPassWrapper(int Count, PassT P) : Count(Count), P(std::move(P)) {}
+  RepeatedPass(int Count, PassT P) : Count(Count), P(std::move(P)) {}
   // We have to explicitly define all the special member functions because MSVC
   // refuses to generate them.
-  RepeatingPassWrapper(const RepeatingPassWrapper &Arg)
-      : Count(Arg.Count), P(Arg.P) {}
-  RepeatingPassWrapper(RepeatingPassWrapper &&Arg)
-      : Count(Arg.Count), P(std::move(Arg.P)) {}
-  friend void swap(RepeatingPassWrapper &LHS, RepeatingPassWrapper &RHS) {
+  RepeatedPass(const RepeatedPass &Arg) : Count(Arg.Count), P(Arg.P) {}
+  RepeatedPass(RepeatedPass &&Arg) : Count(Arg.Count), P(std::move(Arg.P)) {}
+  friend void swap(RepeatedPass &LHS, RepeatedPass &RHS) {
     using std::swap;
     swap(LHS.Count, RHS.Count);
     swap(LHS.P, RHS.P);
   }
-  RepeatingPassWrapper &operator=(RepeatingPassWrapper RHS) {
+  RepeatedPass &operator=(RepeatedPass RHS) {
     swap(*this, RHS);
     return *this;
   }
@@ -1026,8 +1024,8 @@ private:
 };
 
 template <typename PassT>
-RepeatingPassWrapper<PassT> createRepeatingPassWrapper(int Count, PassT P) {
-  return RepeatingPassWrapper<PassT>(Count, std::move(P));
+RepeatedPass<PassT> createRepeatedPass(int Count, PassT P) {
+  return RepeatedPass<PassT>(Count, std::move(P));
 }
 
 }

Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=277689&r1=277688&r2=277689&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Wed Aug  3 22:52:53 2016
@@ -470,7 +470,7 @@ bool PassBuilder::parseModulePass(Module
       if (!parseModulePassPipeline(NestedMPM, InnerPipeline, VerifyEachPass,
                                    DebugLogging))
         return false;
-      MPM.addPass(createRepeatingPassWrapper(*Count, std::move(NestedMPM)));
+      MPM.addPass(createRepeatedPass(*Count, std::move(NestedMPM)));
       return true;
     }
     // Normal passes can't have pipelines.
@@ -557,7 +557,7 @@ bool PassBuilder::parseCGSCCPass(CGSCCPa
       if (!parseCGSCCPassPipeline(NestedCGPM, InnerPipeline, VerifyEachPass,
                                   DebugLogging))
         return false;
-      CGPM.addPass(createRepeatingPassWrapper(*Count, std::move(NestedCGPM)));
+      CGPM.addPass(createRepeatedPass(*Count, std::move(NestedCGPM)));
       return true;
     }
     // Normal passes can't have pipelines.
@@ -617,7 +617,7 @@ bool PassBuilder::parseFunctionPass(Func
       if (!parseFunctionPassPipeline(NestedFPM, InnerPipeline, VerifyEachPass,
                                      DebugLogging))
         return false;
-      FPM.addPass(createRepeatingPassWrapper(*Count, std::move(NestedFPM)));
+      FPM.addPass(createRepeatedPass(*Count, std::move(NestedFPM)));
       return true;
     }
     // Normal passes can't have pipelines.
@@ -667,7 +667,7 @@ bool PassBuilder::parseLoopPass(LoopPass
       if (!parseLoopPassPipeline(NestedLPM, InnerPipeline, VerifyEachPass,
                                  DebugLogging))
         return false;
-      LPM.addPass(createRepeatingPassWrapper(*Count, std::move(NestedLPM)));
+      LPM.addPass(createRepeatedPass(*Count, std::move(NestedLPM)));
       return true;
     }
     // Normal passes can't have pipelines.

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=277689&r1=277688&r2=277689&view=diff
==============================================================================
--- llvm/trunk/test/Other/new-pass-manager.ll (original)
+++ llvm/trunk/test/Other/new-pass-manager.ll Wed Aug  3 22:52:53 2016
@@ -372,7 +372,7 @@
 ; RUN:     -passes='repeat<3>(no-op-module)' %s 2>&1 \
 ; RUN:     | FileCheck %s --check-prefix=CHECK-REPEAT-MODULE-PASS
 ; CHECK-REPEAT-MODULE-PASS: Starting llvm::Module pass manager run
-; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: RepeatingPassWrapper
+; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: RepeatedPass
 ; CHECK-REPEAT-MODULE-PASS-NEXT: Starting llvm::Module pass manager run
 ; CHECK-REPEAT-MODULE-PASS-NEXT: Running pass: NoOpModulePass
 ; CHECK-REPEAT-MODULE-PASS-NEXT: Finished llvm::Module pass manager run
@@ -393,7 +393,7 @@
 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running analysis: LazyCallGraphAnalysis
 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running an SCC pass across the RefSCC: [(foo)]
 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting llvm::LazyCallGraph::SCC pass manager run
-; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: RepeatingPassWrapper
+; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: RepeatedPass
 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Starting llvm::LazyCallGraph::SCC pass manager run
 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Running pass: NoOpCGSCCPass
 ; CHECK-REPEAT-CGSCC-PASS-NEXT: Finished llvm::LazyCallGraph::SCC pass manager run
@@ -413,7 +413,7 @@
 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: ModuleToFunctionPassAdaptor
 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running analysis: InnerAnalysisManagerProxy<{{.*}}>
 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
-; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: RepeatingPassWrapper
+; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: RepeatedPass
 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Starting llvm::Function pass manager run
 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Running pass: NoOpFunctionPass
 ; CHECK-REPEAT-FUNCTION-PASS-NEXT: Finished llvm::Function pass manager run
@@ -438,7 +438,7 @@
 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: LoopAnalysis
 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running analysis: DominatorTreeAnalysis
 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Loop pass manager run
-; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: RepeatingPassWrapper
+; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: RepeatedPass
 ; CHECK-REPEAT-LOOP-PASS-NEXT: Starting llvm::Loop pass manager run
 ; CHECK-REPEAT-LOOP-PASS-NEXT: Running pass: NoOpLoopPass
 ; CHECK-REPEAT-LOOP-PASS-NEXT: Finished llvm::Loop pass manager run




More information about the llvm-commits mailing list