[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-01-12 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h added (r1.1)
---
Log message:

Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.


---
Diffs of the changes:  (+319 -0)

 PassManagers.h |  319 +
 1 files changed, 319 insertions(+)


Index: llvm/include/llvm/PassManagers.h
diff -c /dev/null llvm/include/llvm/PassManagers.h:1.1
*** /dev/null   Fri Jan 12 12:52:54 2007
--- llvm/include/llvm/PassManagers.hFri Jan 12 12:52:44 2007
***
*** 0 
--- 1,319 
+ //===- PassManager.cpp - LLVM Pass Infrastructure Implementation 
--===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Devang Patel and is distributed under
+ // the University of Illinois Open Source License. See LICENSE.TXT for 
details.
+ //
+ 
//===--===//
+ //
+ // This file implements the LLVM Pass Manager infrastructure. 
+ //
+ 
//===--===//
+ 
+ #include "llvm/PassManager.h"
+ 
+ using namespace llvm;
+ class llvm::PMDataManager;
+ class llvm::PMStack;
+ 
+ 
//===--===//
+ // Overview:
+ // The Pass Manager Infrastructure manages passes. It's responsibilities are:
+ // 
+ //   o Manage optimization pass execution order
+ //   o Make required Analysis information available before pass P is run
+ //   o Release memory occupied by dead passes
+ //   o If Analysis information is dirtied by a pass then regenerate Analysis 
+ // information before it is consumed by another pass.
+ //
+ // Pass Manager Infrastructure uses multiple pass managers.  They are
+ // PassManager, FunctionPassManager, MPPassManager, FPPassManager, 
BBPassManager.
+ // This class hierarcy uses multiple inheritance but pass managers do not 
derive
+ // from another pass manager.
+ //
+ // PassManager and FunctionPassManager are two top-level pass manager that
+ // represents the external interface of this entire pass manager 
infrastucture.
+ //
+ // Important classes :
+ //
+ // [o] class PMTopLevelManager;
+ //
+ // Two top level managers, PassManager and FunctionPassManager, derive from 
+ // PMTopLevelManager. PMTopLevelManager manages information used by top level 
+ // managers such as last user info.
+ //
+ // [o] class PMDataManager;
+ //
+ // PMDataManager manages information, e.g. list of available analysis info, 
+ // used by a pass manager to manage execution order of passes. It also 
provides
+ // a place to implement common pass manager APIs. All pass managers derive 
from
+ // PMDataManager.
+ //
+ // [o] class BBPassManager : public FunctionPass, public PMDataManager;
+ //
+ // BBPassManager manages BasicBlockPasses.
+ //
+ // [o] class FunctionPassManager;
+ //
+ // This is a external interface used by JIT to manage FunctionPasses. This
+ // interface relies on FunctionPassManagerImpl to do all the tasks.
+ //
+ // [o] class FunctionPassManagerImpl : public ModulePass, PMDataManager,
+ // public PMTopLevelManager;
+ //
+ // FunctionPassManagerImpl is a top level manager. It manages FPPassManagers
+ //
+ // [o] class FPPassManager : public ModulePass, public PMDataManager;
+ //
+ // FPPassManager manages FunctionPasses and BBPassManagers
+ //
+ // [o] class MPPassManager : public Pass, public PMDataManager;
+ //
+ // MPPassManager manages ModulePasses and FPPassManagers
+ //
+ // [o] class PassManager;
+ //
+ // This is a external interface used by various tools to manages passes. It
+ // relies on PassManagerImpl to do all the tasks.
+ //
+ // [o] class PassManagerImpl : public Pass, public PMDataManager,
+ // public PMDTopLevelManager
+ //
+ // PassManagerImpl is a top level pass manager responsible for managing
+ // MPPassManagers.
+ 
//===--===//
+ 
+ namespace llvm {
+ 
+ 
//===--===//
+ // PMTopLevelManager
+ //
+ /// PMTopLevelManager manages LastUser info and collects common APIs used by
+ /// top level pass managers.
+ class PMTopLevelManager {
+ public:
+ 
+   virtual unsigned getNumContainedManagers() {
+ return PassManagers.size();
+   }
+ 
+   /// Schedule pass P for execution. Make sure that passes required by
+   /// P are run before P is run. Update analysis info maintained by
+   /// the manager. Remove dead passes. This is a recursive function.
+   void schedulePass(Pass *P);
+ 
+   /// This is implemented by top level pass manager and used by 
+   /// schedulePass() to add analysis info passes that are not available.
+   virtual void addTopLevelPass(Pass  *P) = 0;
+ 
+   /// Set pass P as th

[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-01-12 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.1 -> 1.2
---
Log message:

s/addPassToManager/add/g


---
Diffs of the changes:  (+1 -1)

 PassManagers.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.1 
llvm/include/llvm/PassManagers.h:1.2
--- llvm/include/llvm/PassManagers.h:1.1Fri Jan 12 12:52:44 2007
+++ llvm/include/llvm/PassManagers.hFri Jan 12 14:07:16 2007
@@ -198,7 +198,7 @@
 
   /// Add pass P into the PassVector. Update 
   /// AvailableAnalysis appropriately if ProcessAnalysis is true.
-  void addPassToManager(Pass *P, bool ProcessAnalysis = true);
+  void add(Pass *P, bool ProcessAnalysis = true);
 
   /// Initialize available analysis information.
   void initializeAnalysisInfo() { 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-01-15 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.2 -> 1.3
---
Log message:

Remove extra white spaces. Fix comments.


---
Diffs of the changes:  (+2 -2)

 PassManagers.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.2 
llvm/include/llvm/PassManagers.h:1.3
--- llvm/include/llvm/PassManagers.h:1.2Fri Jan 12 14:07:16 2007
+++ llvm/include/llvm/PassManagers.hMon Jan 15 17:06:56 2007
@@ -1,4 +1,4 @@
-//===- PassManager.cpp - LLVM Pass Infrastructure Implementation 
--===//
+//===- llvm/PassManager.h - Pass Inftrastructre classes  *- C++ 
-*-===//
 //
 // The LLVM Compiler Infrastructure
 //
@@ -7,7 +7,7 @@
 //
 
//===--===//
 //
-// This file implements the LLVM Pass Manager infrastructure. 
+// This file declares the LLVM Pass Manager infrastructure. 
 //
 
//===--===//
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-01-15 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.3 -> 1.4
---
Log message:

Code refactoring.


---
Diffs of the changes:  (+8 -0)

 PassManagers.h |8 
 1 files changed, 8 insertions(+)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.3 
llvm/include/llvm/PassManagers.h:1.4
--- llvm/include/llvm/PassManagers.h:1.3Mon Jan 15 17:06:56 2007
+++ llvm/include/llvm/PassManagers.hMon Jan 15 20:00:38 2007
@@ -86,6 +86,13 @@
 
 namespace llvm {
 
+/// FunctionPassManager and PassManager, two top level managers, serve 
+/// as the public interface of pass manager infrastructure.
+enum TopLevelManagerType {
+  TLM_Function,  // FunctionPassManager
+  TLM_Pass   // PassManager
+};
+
 
//===--===//
 // PMTopLevelManager
 //
@@ -118,6 +125,7 @@
   /// then return NULL.
   Pass *findAnalysisPass(AnalysisID AID);
 
+  PMTopLevelManager(enum TopLevelManagerType t);
   virtual ~PMTopLevelManager(); 
 
   /// Add immutable pass and initialize it.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-01-29 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.4 -> 1.5
---
Log message:

Move TimingInfo into PassManagers.h so that other libs can use it.


---
Diffs of the changes:  (+49 -0)

 PassManagers.h |   49 +
 1 files changed, 49 insertions(+)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.4 
llvm/include/llvm/PassManagers.h:1.5
--- llvm/include/llvm/PassManagers.h:1.4Mon Jan 15 20:00:38 2007
+++ llvm/include/llvm/PassManagers.hMon Jan 29 14:06:26 2007
@@ -12,6 +12,7 @@
 
//===--===//
 
 #include "llvm/PassManager.h"
+#include "llvm/Support/Timer.h"
 
 using namespace llvm;
 class llvm::PMDataManager;
@@ -323,5 +324,53 @@
   }
 };
 
+//===--===//
+// TimingInfo Class - This class is used to calculate information about the
+// amount of time each pass takes to execute.  This only happens when
+// -time-passes is enabled on the command line.
+//
+
+class TimingInfo {
+  std::map TimingData;
+  TimerGroup TG;
+
+public:
+  // Use 'create' member to get this.
+  TimingInfo() : TG("... Pass execution timing report ...") {}
+  
+  // TimingDtor - Print out information about timing information
+  ~TimingInfo() {
+// Delete all of the timers...
+TimingData.clear();
+// TimerGroup is deleted next, printing the report.
+  }
+
+  // createTheTimeInfo - This method either initializes the TheTimeInfo pointer
+  // to a non null value (if the -time-passes option is enabled) or it leaves 
it
+  // null.  It may be called multiple times.
+  static void createTheTimeInfo();
+
+  void passStarted(Pass *P) {
+
+if (dynamic_cast(P)) 
+  return;
+
+std::map::iterator I = TimingData.find(P);
+if (I == TimingData.end())
+  I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), 
TG))).first;
+I->second.startTimer();
+  }
+  void passEnded(Pass *P) {
+
+if (dynamic_cast(P)) 
+  return;
+
+std::map::iterator I = TimingData.find(P);
+assert (I != TimingData.end() && "passStarted/passEnded not nested 
right!");
+I->second.stopTimer();
+  }
+};
+
+extern TimingInfo *getTheTimeInfo();
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-01-29 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.5 -> 1.6
---
Log message:

- Undo previous check-in (i.e. Do not export TimingInfo class through
PassManagers.h).

- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager

- Use these two APIs in CalLgraphPassManager to measure timings.


---
Diffs of the changes:  (+2 -49)

 PassManagers.h |   51 ++-
 1 files changed, 2 insertions(+), 49 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.5 
llvm/include/llvm/PassManagers.h:1.6
--- llvm/include/llvm/PassManagers.h:1.5Mon Jan 29 14:06:26 2007
+++ llvm/include/llvm/PassManagers.hMon Jan 29 17:10:37 2007
@@ -12,7 +12,6 @@
 
//===--===//
 
 #include "llvm/PassManager.h"
-#include "llvm/Support/Timer.h"
 
 using namespace llvm;
 class llvm::PMDataManager;
@@ -324,53 +323,7 @@
   }
 };
 
-//===--===//
-// TimingInfo Class - This class is used to calculate information about the
-// amount of time each pass takes to execute.  This only happens when
-// -time-passes is enabled on the command line.
-//
-
-class TimingInfo {
-  std::map TimingData;
-  TimerGroup TG;
-
-public:
-  // Use 'create' member to get this.
-  TimingInfo() : TG("... Pass execution timing report ...") {}
-  
-  // TimingDtor - Print out information about timing information
-  ~TimingInfo() {
-// Delete all of the timers...
-TimingData.clear();
-// TimerGroup is deleted next, printing the report.
-  }
-
-  // createTheTimeInfo - This method either initializes the TheTimeInfo pointer
-  // to a non null value (if the -time-passes option is enabled) or it leaves 
it
-  // null.  It may be called multiple times.
-  static void createTheTimeInfo();
-
-  void passStarted(Pass *P) {
-
-if (dynamic_cast(P)) 
-  return;
-
-std::map::iterator I = TimingData.find(P);
-if (I == TimingData.end())
-  I=TimingData.insert(std::make_pair(P, Timer(P->getPassName(), 
TG))).first;
-I->second.startTimer();
-  }
-  void passEnded(Pass *P) {
-
-if (dynamic_cast(P)) 
-  return;
-
-std::map::iterator I = TimingData.find(P);
-assert (I != TimingData.end() && "passStarted/passEnded not nested 
right!");
-I->second.stopTimer();
-  }
-};
-
-extern TimingInfo *getTheTimeInfo();
 }
 
+extern void StartPassTimer(Pass *);
+extern void StopPassTimer(Pass *);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-02-01 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.6 -> 1.7
---
Log message:

Pretty print pass managers.


---
Diffs of the changes:  (+4 -0)

 PassManagers.h |4 
 1 files changed, 4 insertions(+)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.6 
llvm/include/llvm/PassManagers.h:1.7
--- llvm/include/llvm/PassManagers.h:1.6Mon Jan 29 17:10:37 2007
+++ llvm/include/llvm/PassManagers.hThu Feb  1 16:10:12 2007
@@ -312,6 +312,10 @@
   // Print passes managed by this manager
   void dumpPassStructure(unsigned Offset);
 
+  virtual const char *getPassName() const {
+return "Function Pass Manager";
+  }
+
   FunctionPass *getContainedPass(unsigned N) {
 assert ( N < PassVector.size() && "Pass number out of range!");
 FunctionPass *FP = static_cast(PassVector[N]);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-02-16 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.7 -> 1.8
---
Log message:

Use inverted map to speedup collectLastUses().


---
Diffs of the changes:  (+5 -0)

 PassManagers.h |5 +
 1 files changed, 5 insertions(+)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.7 
llvm/include/llvm/PassManagers.h:1.8
--- llvm/include/llvm/PassManagers.h:1.7Thu Feb  1 16:10:12 2007
+++ llvm/include/llvm/PassManagers.hFri Feb 16 21:53:44 2007
@@ -120,6 +120,10 @@
   /// Collect passes whose last user is P
   void collectLastUses(std::vector &LastUses, Pass *P);
 
+  // Walk LastUser map and create inverted map. This should be done
+  // after all passes are added and before running first pass.
+  void collectInvertedLU();
+
   /// Find the pass that implements Analysis AID. Search immutable
   /// passes and all pass managers. If desired pass is not found
   /// then return NULL.
@@ -171,6 +175,7 @@
   // Map to keep track of last user of the analysis pass.
   // LastUser->second is the last user of Lastuser->first.
   std::map LastUser;
+  std::map > InvertedLU;
 
   /// Immutable passes are managed by top level manager.
   std::vector ImmutablePasses;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-02-17 Thread Chris Lattner


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.8 -> 1.9
---
Log message:

temporarily revert Devang's most recent patch, which caused a large 
compile-time regression in LLC.


---
Diffs of the changes:  (+0 -5)

 PassManagers.h |5 -
 1 files changed, 5 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.8 
llvm/include/llvm/PassManagers.h:1.9
--- llvm/include/llvm/PassManagers.h:1.8Fri Feb 16 21:53:44 2007
+++ llvm/include/llvm/PassManagers.hSat Feb 17 17:14:24 2007
@@ -120,10 +120,6 @@
   /// Collect passes whose last user is P
   void collectLastUses(std::vector &LastUses, Pass *P);
 
-  // Walk LastUser map and create inverted map. This should be done
-  // after all passes are added and before running first pass.
-  void collectInvertedLU();
-
   /// Find the pass that implements Analysis AID. Search immutable
   /// passes and all pass managers. If desired pass is not found
   /// then return NULL.
@@ -175,7 +171,6 @@
   // Map to keep track of last user of the analysis pass.
   // LastUser->second is the last user of Lastuser->first.
   std::map LastUser;
-  std::map > InvertedLU;
 
   /// Immutable passes are managed by top level manager.
   std::vector ImmutablePasses;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-02-27 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.9 -> 1.10
---
Log message:

Make getPassManagerType() const.


---
Diffs of the changes:  (+2 -2)

 PassManagers.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.9 
llvm/include/llvm/PassManagers.h:1.10
--- llvm/include/llvm/PassManagers.h:1.9Sat Feb 17 17:14:24 2007
+++ llvm/include/llvm/PassManagers.hTue Feb 27 09:00:39 2007
@@ -250,7 +250,7 @@
 return PassVector.size();
   }
 
-  virtual PassManagerType getPassManagerType() { 
+  virtual PassManagerType getPassManagerType() const { 
 assert ( 0 && "Invalid use of getPassManagerType");
 return PMT_Unknown; 
   }
@@ -322,7 +322,7 @@
 return FP;
   }
 
-  virtual PassManagerType getPassManagerType() { 
+  virtual PassManagerType getPassManagerType() const { 
 return PMT_FunctionPassManager; 
   }
 };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-03-05 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.10 -> 1.11
---
Log message:

Avoid constructing std::strings unless pass debugging is ON.


---
Diffs of the changes:  (+15 -2)

 PassManagers.h |   17 +++--
 1 files changed, 15 insertions(+), 2 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.10 
llvm/include/llvm/PassManagers.h:1.11
--- llvm/include/llvm/PassManagers.h:1.10   Tue Feb 27 09:00:39 2007
+++ llvm/include/llvm/PassManagers.hMon Mar  5 14:01:30 2007
@@ -93,6 +93,18 @@
   TLM_Pass   // PassManager
 };
 
+// enums for debugging strings
+enum PassDebuggingString {
+  EXECUTION_MSG, // "Executing Pass '"
+  MODIFICATION_MSG, // "' Made Modification '"
+  FREEING_MSG, // " Freeing Pass '"
+  ON_BASICBLOCK_MSG, // "'  on BasicBlock '" + PassName + "'...\n"
+  ON_FUNCTION_MSG, // "' on Function '" + FunctionName + "'...\n"
+  ON_MODULE_MSG, // "' on Module '" + ModuleName + "'...\n"
+  ON_LOOP_MSG, // " 'on Loop ...\n'"
+  ON_CG_MSG // "' on Call Graph ...\n'"
+};  
+
 
//===--===//
 // PMTopLevelManager
 //
@@ -202,7 +214,7 @@
   void removeNotPreservedAnalysis(Pass *P);
   
   /// Remove dead passes
-  void removeDeadPasses(Pass *P, std::string &Msg);
+  void removeDeadPasses(Pass *P, std::string Msg, enum PassDebuggingString);
 
   /// Add pass P into the PassVector. Update 
   /// AvailableAnalysis appropriately if ProcessAnalysis is true.
@@ -238,7 +250,8 @@
   // Print routines used by debug-pass
   void dumpLastUses(Pass *P, unsigned Offset) const;
   void dumpPassArguments() const;
-  void dumpPassInfo(Pass *P,  std::string &Msg1, std::string &Msg2) const;
+  void dumpPassInfo(Pass *P, enum PassDebuggingString S1,
+enum PassDebuggingString S2, std::string Msg);
   void dumpAnalysisSetInfo(const char *Msg, Pass *P,
const std::vector &Set) const;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-03-05 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.11 -> 1.12
---
Log message:

Current pass manager, not the parent pass manager,  assumes the role of 
last user when one of the managed pass uses info provided by parent pass 
manager.

This was exposed by LPPassManager work.


---
Diffs of the changes:  (+0 -11)

 PassManagers.h |   11 ---
 1 files changed, 11 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.11 
llvm/include/llvm/PassManagers.h:1.12
--- llvm/include/llvm/PassManagers.h:1.11   Mon Mar  5 14:01:30 2007
+++ llvm/include/llvm/PassManagers.hMon Mar  5 16:57:49 2007
@@ -222,7 +222,6 @@
 
   /// Initialize available analysis information.
   void initializeAnalysisInfo() { 
-TransferLastUses.clear();
 AvailableAnalysis.clear();
   }
 
@@ -255,10 +254,6 @@
   void dumpAnalysisSetInfo(const char *Msg, Pass *P,
const std::vector &Set) const;
 
-  std::vector& getTransferredLastUses() {
-return TransferLastUses;
-  }
-
   virtual unsigned getNumContainedPasses() { 
 return PassVector.size();
   }
@@ -269,12 +264,6 @@
   }
 protected:
 
-  // If a FunctionPass F is the last user of ModulePass info M
-  // then the F's manager, not F, records itself as a last user of M.
-  // Current pass manage is requesting parent manager to record parent
-  // manager as the last user of these TrransferLastUses passes.
-  std::vector TransferLastUses;
-
   // Top level manager.
   PMTopLevelManager *TPM;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-03-06 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.13 -> 1.14
---
Log message:

Keep track of higher level analysis.


---
Diffs of the changes:  (+9 -0)

 PassManagers.h |9 +
 1 files changed, 9 insertions(+)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.13 
llvm/include/llvm/PassManagers.h:1.14
--- llvm/include/llvm/PassManagers.h:1.13   Mon Mar  5 19:55:46 2007
+++ llvm/include/llvm/PassManagers.hTue Mar  6 11:52:53 2007
@@ -228,6 +228,11 @@
   InheritedAnalysis[i] = NULL;
   }
 
+  // Return true if P preserves high level analysis used by other
+  // passes that are managed by this manager.
+  bool preserveHigherLevelAnalysis(Pass *P);
+
+
   /// Populate RequiredPasses with the analysis pass that are required by
   /// pass P.
   void collectRequiredAnalysisPasses(std::vector &RequiredPasses,
@@ -298,6 +303,10 @@
   // scheduled to run.
   std::map AvailableAnalysis;
 
+  // Collection of higher level analysis used by the pass managed by
+  // this manager.
+  std::vector HigherLevelAnalysis;
+
   unsigned Depth;
 };
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-04-16 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.15 -> 1.16
---
Log message:

Give each pass manager chance to manage lower level analysis pass, which is
pass required by one of pass managed by the manager.


---
Diffs of the changes:  (+20 -5)

 PassManagers.h |   25 -
 1 files changed, 20 insertions(+), 5 deletions(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.15 
llvm/include/llvm/PassManagers.h:1.16
--- llvm/include/llvm/PassManagers.h:1.15   Fri Mar 23 13:44:11 2007
+++ llvm/include/llvm/PassManagers.hMon Apr 16 15:12:57 2007
@@ -12,7 +12,7 @@
 
//===--===//
 
 #include "llvm/PassManager.h"
-
+#include "llvm/ADT/SmallVector.h"
 using namespace llvm;
 class llvm::PMDataManager;
 class llvm::PMStack;
@@ -221,6 +221,19 @@
   /// AvailableAnalysis appropriately if ProcessAnalysis is true.
   void add(Pass *P, bool ProcessAnalysis = true);
 
+  /// Add RequiredPass into list of lower level passes required by pass P.
+  /// RequiredPass is run on the fly by Pass Manager when P requests it
+  /// through getAnalysis interface.
+  virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) {
+assert (0 && 
+"Unable to handle Pass that requires lower level Analysis pass");
+  }
+
+  virtual Pass * getOnTheFlyPass(Pass *P, const PassInfo *PI, Function &F) {
+assert (0 && "Unable to find on the fly pass");
+return NULL;
+  }
+
   /// Initialize available analysis information.
   void initializeAnalysisInfo() { 
 AvailableAnalysis.clear();
@@ -233,10 +246,12 @@
   bool preserveHigherLevelAnalysis(Pass *P);
 
 
-  /// Populate RequiredPasses with the analysis pass that are required by
-  /// pass P.
-  void collectRequiredAnalysisPasses(std::vector &RequiredPasses,
- Pass *P);
+  /// Populate RequiredPasses with analysis pass that are required by
+  /// pass P and are available. Populate ReqPassNotAvailable with analysis
+  /// pass that are required by pass P but are not available.
+  void collectRequiredAnalysis(SmallVector &RequiredPasses,
+   SmallVector &ReqPassNotAvailable,
+   Pass *P);
 
   /// All Required analyses should be available to the pass as it runs!  Here
   /// we fill in the AnalysisImpls member of the pass so that it can



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-05-02 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.17 -> 1.18
---
Log message:

Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces 
static const int, which defauts PassID based pass identification.


---
Diffs of the changes:  (+1 -1)

 PassManagers.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.17 
llvm/include/llvm/PassManagers.h:1.18
--- llvm/include/llvm/PassManagers.h:1.17   Tue May  1 16:15:46 2007
+++ llvm/include/llvm/PassManagers.hWed May  2 16:39:18 2007
@@ -336,7 +336,7 @@
 class FPPassManager : public ModulePass, public PMDataManager {
  
 public:
-  static const int ID;
+  static const char ID;
   explicit FPPassManager(int Depth) 
   : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/PassManagers.h

2007-05-02 Thread Devang Patel


Changes in directory llvm/include/llvm:

PassManagers.h updated: 1.18 -> 1.19
---
Log message:

Drop 'const'


---
Diffs of the changes:  (+1 -1)

 PassManagers.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/include/llvm/PassManagers.h
diff -u llvm/include/llvm/PassManagers.h:1.18 
llvm/include/llvm/PassManagers.h:1.19
--- llvm/include/llvm/PassManagers.h:1.18   Wed May  2 16:39:18 2007
+++ llvm/include/llvm/PassManagers.hWed May  2 20:11:53 2007
@@ -336,7 +336,7 @@
 class FPPassManager : public ModulePass, public PMDataManager {
  
 public:
-  static const char ID;
+  static char ID;
   explicit FPPassManager(int Depth) 
   : ModulePass((intptr_t)&ID), PMDataManager(Depth) { }
   



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits