Fix PR1158
authorDevang Patel <dpatel@apple.com>
Mon, 5 Feb 2007 19:34:17 +0000 (19:34 +0000)
committerDevang Patel <dpatel@apple.com>
Mon, 5 Feb 2007 19:34:17 +0000 (19:34 +0000)
Do not insert Analysis pass, if it is already available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33915 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/PassManager.cpp

index f8b311be7ec472665a1f7844946f9a40e56516a6..02938710fac8e3aff6ecd128ca7e7926876f4ecb 100644 (file)
@@ -377,6 +377,11 @@ void PMTopLevelManager::schedulePass(Pass *P) {
   // TODO : Allocate function manager for this pass, other wise required set
   // may be inserted into previous function manager
 
+  // If this Analysis is already requested by one of the previous pass
+  // and it is still available then do not insert new pass in the queue again.
+  if (findAnalysisPass(P->getPassInfo()))
+      return;
+
   AnalysisUsage AnUsage;
   P->getAnalysisUsage(AnUsage);
   const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet();