[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h (r1.75) removed --- Log message: Remove PassManagerT.h --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.69 - 1.70 --- Log message: Update comment. Valid option is -debug-pass=Structures. --- Diffs of the changes: (+1 -1) PassManagerT.h |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.69 llvm/lib/VMCore/PassManagerT.h:1.70 --- llvm/lib/VMCore/PassManagerT.h:1.69 Sat Sep 2 18:09:24 2006 +++ llvm/lib/VMCore/PassManagerT.h Mon Oct 30 13:25:54 2006 @@ -282,7 +282,7 @@ return runPasses(M, LastUserOf); } - // dumpPassStructure - Implement the -debug-passes=PassStructure option + // dumpPassStructure - Implement the -debug-passes=Structure option inline void dumpPassStructure(unsigned Offset = 0) { // Print out the immutable passes... ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.68 - 1.69 --- Log message: Count the time for a pass to ReleaseMemory against that pass. Not doing this was under accounting for the time that livevariables cost --- Diffs of the changes: (+2 -0) PassManagerT.h |2 ++ 1 files changed, 2 insertions(+) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.68 llvm/lib/VMCore/PassManagerT.h:1.69 --- llvm/lib/VMCore/PassManagerT.h:1.68 Sun Aug 27 19:08:25 2006 +++ llvm/lib/VMCore/PassManagerT.h Sat Sep 2 18:09:24 2006 @@ -670,7 +670,9 @@ for (std::vectorPass*::iterator I = DeadPass.begin(),E = DeadPass.end(); I != E; ++I) { PMDebug::PrintPassInformation(getDepth()+1, Freeing Pass, *I, M); + if (TheTimeInfo) TheTimeInfo-passStarted(*I); (*I)-releaseMemory(); + if (TheTimeInfo) TheTimeInfo-passEnded(*I); } for (std::mapAnalysisID, Pass*::iterator I = CurrentAnalyses.begin(); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.67 - 1.68 --- Log message: Silence -Woverloaded-virtual warnings. --- Diffs of the changes: (+11 -1) PassManagerT.h | 12 +++- 1 files changed, 11 insertions(+), 1 deletion(-) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.67 llvm/lib/VMCore/PassManagerT.h:1.68 --- llvm/lib/VMCore/PassManagerT.h:1.67 Thu Jan 12 10:48:23 2006 +++ llvm/lib/VMCore/PassManagerT.h Sun Aug 27 19:08:25 2006 @@ -720,6 +720,10 @@ PassManagerTBBTraits(BBPM-Parent) { } + virtual bool runPass(Module M) { return false; } + + virtual bool runPass(BasicBlock BB) { return BasicBlockPass::runPass(BB); } + // runPass - Specify how the pass should be run on the UnitType virtual bool runPass(BBTraits::PassClass *P, BasicBlock *M) { // TODO: init and finalize @@ -790,6 +794,9 @@ AU.setPreservesAll(); } + virtual bool runPass(Module M) { return FunctionPass::runPass(M); } + virtual bool runPass(BasicBlock BB) { return FunctionPass::runPass(BB); } + // runPass - Specify how the pass should be run on the UnitType virtual bool runPass(FTraits::PassClass *P, Function *F) { return P-runOnFunction(*F); @@ -831,7 +838,10 @@ // runOnModule - Implement the PassManager interface. virtual bool runOnModule(Module M); - + + virtual bool runPass(Module M) { return ModulePass::runPass(M); } + virtual bool runPass(BasicBlock BB) { return ModulePass::runPass(BB); } + // runPass - Specify how the pass should be run on the UnitType virtual bool runPass(MTraits::PassClass *P, Module *M) { return P-runOnModule(*M); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.66 - 1.67 --- Log message: Patch #10 from Saem: Extracts a few more methods, reduces some redundancy in the code at the same time. --- Diffs of the changes: (+32 -52) PassManagerT.h | 84 + 1 files changed, 32 insertions(+), 52 deletions(-) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.66 llvm/lib/VMCore/PassManagerT.h:1.67 --- llvm/lib/VMCore/PassManagerT.h:1.66 Wed Jan 11 10:14:49 2006 +++ llvm/lib/VMCore/PassManagerT.h Thu Jan 12 10:48:23 2006 @@ -472,33 +472,10 @@ E = RequiredSet.end(); I != E; ++I) markPassUsed(*I, P); // Mark *I as used by P -// Erase all analyses not in the preserved set... -if (!AnUsage.getPreservesAll()) { - const std::vectorAnalysisID PreservedSet = AnUsage.getPreservedSet(); - for (std::mapAnalysisID, Pass*::iterator I = CurrentAnalyses.begin(), - E = CurrentAnalyses.end(); I != E; ) { -if (std::find(PreservedSet.begin(), PreservedSet.end(), I-first) == -PreservedSet.end()) { // Analysis not preserved! - CurrentAnalyses.erase(I); // Remove from available analyses - I = CurrentAnalyses.begin(); -} else { - ++I; -} - } -} - -// Add this pass to the currently available set... -if (const PassInfo *PI = P-getPassInfo()) { - CurrentAnalyses[PI] = P; - - // This pass is the current implementation of all of the interfaces it - // implements as well. - // - const std::vectorconst PassInfo* II = PI-getInterfacesImplemented(); - for (unsigned i = 0, e = II.size(); i != e; ++i) -CurrentAnalyses[II[i]] = P; -} - +removeNonPreservedAnalyses(AnUsage); + +makeCurrentlyAvailable(P); + // For now assume that our results are never used... LastUseOf[P] = P; } @@ -632,30 +609,10 @@ // Erase all analyses not in the preserved set removeNonPreservedAnalyses(AnUsage); - // Add the current pass to the set of passes that have been run, and are - // thus available to users. - // - if (const PassInfo *PI = P-getPassInfo()) { -CurrentAnalyses[PI] = P; - -// This pass is the current implementation of all of the interfaces it -// implements as well. -// -const std::vectorconst PassInfo* II = PI-getInterfacesImplemented(); -for (unsigned i = 0, e = II.size(); i != e; ++i) - CurrentAnalyses[II[i]] = P; - } - - // Free memory for any passes that we are the last use of... - std::vectorPass* DeadPass = LastUserOf[P]; - for (std::vectorPass*::iterator I = DeadPass.begin(),E = DeadPass.end(); - I != E; ++I) { -PMDebug::PrintPassInformation(getDepth()+1, Freeing Pass, *I, M); -(*I)-releaseMemory(); - } + makeCurrentlyAvailable(P); - // remove dead passes from the CurrentAnalyses list... - removeDeadPasses(DeadPass); + // free memory and remove dead passes from the CurrentAnalyses list... + removeDeadPasses(P, M, LastUserOf); } return MadeChanges; @@ -707,7 +664,15 @@ } } - inline void removeDeadPasses(std::vectorPass* DeadPass) { + inline void removeDeadPasses(Pass* P, UnitType *M, + std::mapPass *, std::vectorPass* LastUserOf) { +std::vectorPass* DeadPass = LastUserOf[P]; +for (std::vectorPass*::iterator I = DeadPass.begin(),E = DeadPass.end(); + I != E; ++I) { + PMDebug::PrintPassInformation(getDepth()+1, Freeing Pass, *I, M); + (*I)-releaseMemory(); +} + for (std::mapAnalysisID, Pass*::iterator I = CurrentAnalyses.begin(); I != CurrentAnalyses.end(); ) { std::vectorPass*::iterator DPI = std::find(DeadPass.begin(), @@ -720,8 +685,23 @@ } } } + + inline void makeCurrentlyAvailable(Pass* P) { +if (const PassInfo *PI = P-getPassInfo()) { + CurrentAnalyses[PI] = P; + + // This pass is the current implementation of all of the interfaces it + // implements as well. + // + const std::vectorconst PassInfo* II = PI-getInterfacesImplemented(); + for (unsigned i = 0, e = II.size(); i != e; ++i) +CurrentAnalyses[II[i]] = P; +} + } }; + + //===--===// // BasicBlockPassManager // @@ -859,7 +839,7 @@ }; //===--===// -// PassManagerTraits Method Implementations +// PassManager Method Implementations // // BasicBlockPassManager Implementations ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.63 - 1.64 --- Log message: Patch #7 from Saem: added the asserts and casts, fixed the comments and started the break down of the larger methods. A few more patches and the breakdown should be complete. --- Diffs of the changes: (+37 -36) PassManagerT.h | 73 - 1 files changed, 37 insertions(+), 36 deletions(-) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.63 llvm/lib/VMCore/PassManagerT.h:1.64 --- llvm/lib/VMCore/PassManagerT.h:1.63 Wed Jan 4 01:47:13 2006 +++ llvm/lib/VMCore/PassManagerT.h Sat Jan 7 17:16:58 2006 @@ -123,8 +123,6 @@ static TimingInfo *TheTimeInfo; -// FIXME:I'm not sure if this is the best way, but this was the only way I -// could get around the recursive template issues. -- Saem struct BBTraits { typedef BasicBlock UnitType; @@ -138,7 +136,7 @@ typedef BasicBlockPassManager SubPassClass; // BatcherClass - The type to use for collation of subtypes... This class is - // never instantiated for the PassManagerBasicBlock, but it must be an + // never instantiated for the BasicBlockPassManager, but it must be an // instance of PassClass to typecheck. // typedef PassClass BatcherClass; @@ -287,7 +285,10 @@ LastUserOf[I-second].push_back(I-first); // Output debug information... -if (Parent == 0) PMDebug::PerformPassStartupStuff((dynamic_castPassClass*(this))); +assert(dynamic_castPassClass*(this) + It wasn't the PassClass I thought it was); +if (Parent == 0) + PMDebug::PerformPassStartupStuff((dynamic_castPassClass*(this))); // Run all of the passes for (unsigned i = 0, e = Passes.size(); i e; ++i) { @@ -491,6 +492,8 @@ // frees the analysis AFTER this pass manager runs. // if (Parent) { +assert(dynamic_castPass*(this) + It wasn't the Pass type I thought it was.); Parent-markPassUsed(P, dynamic_castPass*(this)); } else { assert(getAnalysisOrNullUp(P) @@ -508,6 +511,7 @@ } virtual unsigned getNumContainedPasses() const { return Passes.size(); } + virtual const Pass *getContainedPass(unsigned N) const { assert(N Passes.size() Pass number out of range!); return Passes[N]; @@ -522,24 +526,16 @@ // Get information about what analyses the pass uses... AnalysisUsage AnUsage; P-getAnalysisUsage(AnUsage); -const std::vectorAnalysisID Required = AnUsage.getRequiredSet(); - -// Loop over all of the analyses used by this pass, -for (std::vectorAnalysisID::const_iterator I = Required.begin(), - E = Required.end(); I != E; ++I) { - if (getAnalysisOrNullDown(*I) == 0) { -Pass *AP = (*I)-createPass(); -if (ImmutablePass *IP = dynamic_castImmutablePass * (AP)) { add(IP); } -else if (PassClass *RP = dynamic_castPassClass * (AP)) { add(RP); } -else { assert (0 Wrong kind of pass for this PassManager); } - } -} - + +addRequiredPasses(AnUsage.getRequiredSet()); + // Tell the pass to add itself to this PassManager... the way it does so // depends on the class of the pass, and is critical to laying out passes in // an optimal order.. // -P-addToPassManager(dynamic_castPMType*(this), AnUsage); +assert(dynamic_castPMType*(this) +It wasn't the right passmanager type.); +P-addToPassManager(static_castPMType*(this), AnUsage); } // add - H4x0r an ImmutablePass into a PassManager that might not be @@ -549,19 +545,9 @@ // Get information about what analyses the pass uses... AnalysisUsage AnUsage; P-getAnalysisUsage(AnUsage); -const std::vectorAnalysisID Required = AnUsage.getRequiredSet(); - -// Loop over all of the analyses used by this pass, -for (std::vectorAnalysisID::const_iterator I = Required.begin(), - E = Required.end(); I != E; ++I) { - if (getAnalysisOrNullDown(*I) == 0) { -Pass *AP = (*I)-createPass(); -if (ImmutablePass *IP = dynamic_castImmutablePass * (AP)) add(IP); -else if (PassClass *RP = dynamic_castPassClass * (AP)) add(RP); -else assert (0 Wrong kind of pass for this PassManager); - } -} - + +addRequiredPasses(AnUsage.getRequiredSet()); + // Add the ImmutablePass to this PassManager. addPass(P, AnUsage); } @@ -581,11 +567,10 @@ const std::vectorAnalysisID RequiredSet = AnUsage.getRequiredSet(); // FIXME: If this pass being added isn't killed by any of the passes in the -// batcher class then we can reorder to pass to execute before the batcher +// batcher class then we can reorder the pass to execute before the batcher // does, which will potentially allow us to batch more passes! // -// const std::vectorAnalysisID ProvidedSet = AnUsage.getProvidedSet(); -if
[llvm-commits] CVS: llvm/lib/VMCore/PassManagerT.h
Changes in directory llvm/lib/VMCore: PassManagerT.h updated: 1.59 - 1.60 --- Log message: silence some warnings --- Diffs of the changes: (+6 -0) PassManagerT.h |6 ++ 1 files changed, 6 insertions(+) Index: llvm/lib/VMCore/PassManagerT.h diff -u llvm/lib/VMCore/PassManagerT.h:1.59 llvm/lib/VMCore/PassManagerT.h:1.60 --- llvm/lib/VMCore/PassManagerT.h:1.59 Tue Jan 3 01:05:17 2006 +++ llvm/lib/VMCore/PassManagerT.h Tue Jan 3 11:52:18 2006 @@ -652,6 +652,8 @@ // PMType - The type of the passmanager that subclasses this class typedef PassManagerTBasicBlock PMType; + virtual ~BasicBlockPassManager() {} + // getPMName() - Return the name of the unit the PassManager operates on for // debugging. virtual const char *getPMName() const { return BasicBlock; } @@ -719,6 +721,8 @@ // PMType - The type of the passmanager that subclasses this class typedef PassManagerTFunction PMType; + virtual ~FunctionPassManagerT() {} + // getPMName() - Return the name of the unit the PassManager operates on for // debugging. virtual const char *getPMName() const { return Function; } @@ -778,6 +782,8 @@ // ParentClass - The type of the parent PassManager... typedef AnalysisResolver ParentClass; + virtual ~ModulePassManager() {} + // getPMName() - Return the name of the unit the PassManager operates on for // debugging. virtual const char *getPassName() const { return Module Pass Manager; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits