Add suppport for ConstantExprs of shufflevectors whose result type is not equal to the
[oota-llvm.git] / include / llvm / PassManagers.h
index a97f4f3e1a6b813e5ccf618581f5aeb5c4ddc624..22d5062b6b1676e2e1a1b645945858ab14379c3f 100644 (file)
@@ -1,4 +1,4 @@
-//===- llvm/PassManager.h - Pass Inftrastructre classes  --------*- C++ -*-===//
+//===- llvm/PassManagers.h - Pass Infrastructure classes  -------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_PASSMANAGERS_H
+#define LLVM_PASSMANAGERS_H
+
 #include "llvm/PassManager.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/DenseMap.h"
 #include <deque>
 #include <map>
 // MPPassManagers.
 //===----------------------------------------------------------------------===//
 
-#ifndef PASSMANAGERS_H
-#define PASSMANAGERS_H
-
-#include "llvm/Pass.h"
-#include <deque>
-
 namespace llvm {
 
 /// FunctionPassManager and PassManager, two top level managers, serve 
@@ -185,7 +183,7 @@ public:
     ImmutablePasses.push_back(P);
   }
 
-  inline std::vector<ImmutablePass *>& getImmutablePasses() {
+  inline SmallVector<ImmutablePass *, 8>& getImmutablePasses() {
     return ImmutablePasses;
   }
 
@@ -211,20 +209,25 @@ public:
 protected:
   
   /// Collection of pass managers
-  std::vector<PMDataManager *> PassManagers;
+  SmallVector<PMDataManager *, 8> PassManagers;
 
 private:
 
   /// Collection of pass managers that are not directly maintained
   /// by this pass manager
-  std::vector<PMDataManager *> IndirectPassManagers;
+  SmallVector<PMDataManager *, 8> IndirectPassManagers;
 
   // Map to keep track of last user of the analysis pass.
   // LastUser->second is the last user of Lastuser->first.
-  std::map<Pass *, Pass *> LastUser;
+  DenseMap<Pass *, Pass *> LastUser;
+
+  // Map to keep track of passes that are last used by a pass.
+  // This inverse map is initialized at PM->run() based on
+  // LastUser map.
+  DenseMap<Pass *, SmallPtrSet<Pass *, 8> > InversedLastUser;
 
   /// Immutable passes are managed by top level manager.
-  std::vector<ImmutablePass *> ImmutablePasses;
+  SmallVector<ImmutablePass *, 8> ImmutablePasses;
 
   DenseMap<Pass *, AnalysisUsage *> AnUsageMap;
 };
@@ -344,7 +347,7 @@ protected:
   PMTopLevelManager *TPM;
 
   // Collection of pass that are managed by this manager
-  std::vector<Pass *> PassVector;
+  SmallVector<Pass *, 16> PassVector;
 
   // Collection of Analysis provided by Parent pass manager and
   // used by current pass manager. At at time there can not be more
@@ -363,7 +366,7 @@ private:
 
   // Collection of higher level analysis used by the pass managed by
   // this manager.
-  std::vector<Pass *> HigherLevelAnalysis;
+  SmallVector<Pass *, 8> HigherLevelAnalysis;
 
   unsigned Depth;
 };
@@ -425,4 +428,3 @@ extern void StartPassTimer(llvm::Pass *);
 extern void StopPassTimer(llvm::Pass *);
 
 #endif
-