diff options
author | Devang Patel <dpatel@apple.com> | 2008-03-18 00:39:19 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-03-18 00:39:19 +0000 |
commit | 1cee94f04111cfd7114979d6dfddce2669c9380d (patch) | |
tree | dcbe3d4a2811447eec457bce66c90106e4245c24 /lib/VMCore | |
parent | b176038f989d98ac9f5f1dc2b52b6ef1723b2b78 (diff) | |
download | external_llvm-1cee94f04111cfd7114979d6dfddce2669c9380d.zip external_llvm-1cee94f04111cfd7114979d6dfddce2669c9380d.tar.gz external_llvm-1cee94f04111cfd7114979d6dfddce2669c9380d.tar.bz2 |
Identify Analysis pass.
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/PassManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/VMCore/PassManager.cpp b/lib/VMCore/PassManager.cpp index e7d7c5b..b0afaef 100644 --- a/lib/VMCore/PassManager.cpp +++ b/lib/VMCore/PassManager.cpp @@ -426,6 +426,12 @@ void PMTopLevelManager::schedulePass(Pass *P) { // Give pass a chance to prepare the stage. P->preparePassManager(activeStack); + // If P is an analysis pass and it is available then do not + // generate the analysis again. Stale analysis info should not be + // available at this point. + if (P->isAnalysis() && findAnalysisPass(P->getPassInfo())) + return; + AnalysisUsage AnUsage; P->getAnalysisUsage(AnUsage); const std::vector<AnalysisID> &RequiredSet = AnUsage.getRequiredSet(); |