Revert constant-folding change that will miscompile in some cases.
[oota-llvm.git] / lib / VMCore / PassManager.cpp
index c76a9e873927ce73bf72b851578fceb2a131e6e0..add652986d1cca9452d2f3930826ef1a2746c2da 100644 (file)
@@ -360,10 +360,10 @@ public:
   }
 };
 
-static TimingInfo *TheTimeInfo;
-
 } // End of anon namespace
 
+static TimingInfo *TheTimeInfo;
+
 //===----------------------------------------------------------------------===//
 // PMTopLevelManager implementation
 
@@ -1159,6 +1159,9 @@ bool FPPassManager::runOnFunction(Function &F) {
 
   if (F.isDeclaration())
     return false;
+  
+  // Collect inherited analysis from Module level pass manager.
+  populateInheritedAnalysis(TPM->activeStack);
 
   for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
     FunctionPass *FP = getContainedPass(Index);
@@ -1471,6 +1474,7 @@ void FunctionPass::assignPassManager(PMStack &PMS,
 
     // [1] Create new Function Pass Manager
     FPP = new FPPassManager(PMD->getDepth() + 1);
+    FPP->populateInheritedAnalysis(PMS);
 
     // [2] Set up new manager's top level manager
     PMTopLevelManager *TPM = PMD->getTopLevelManager();