summaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LegacyPassManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/LegacyPassManager.cpp')
-rw-r--r--llvm/lib/IR/LegacyPassManager.cpp46
1 files changed, 6 insertions, 40 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index 9c44eff7953a..96e2f1d7908b 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -12,7 +12,6 @@
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/ADT/MapVector.h"
-#include "llvm/Demangle/Demangle.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/LLVMContext.h"
@@ -808,13 +807,6 @@ void PMTopLevelManager::addImmutablePass(ImmutablePass *P) {
// doing lookups.
AnalysisID AID = P->getPassID();
ImmutablePassMap[AID] = P;
-
- // Also add any interfaces implemented by the immutable pass to the map for
- // fast lookup.
- const PassInfo *PassInf = findAnalysisPassInfo(AID);
- assert(PassInf && "Expected all immutable passes to be initialized");
- for (const PassInfo *ImmPI : PassInf->getInterfacesImplemented())
- ImmutablePassMap[ImmPI->getTypeInfo()] = P;
}
// Print passes managed by this top level manager.
@@ -844,8 +836,7 @@ void PMTopLevelManager::dumpArguments() const {
for (ImmutablePass *P : ImmutablePasses)
if (const PassInfo *PI = findAnalysisPassInfo(P->getPassID())) {
assert(PI && "Expected all immutable passes to be initialized");
- if (!PI->isAnalysisGroup())
- dbgs() << " -" << PI->getPassArgument();
+ dbgs() << " -" << PI->getPassArgument();
}
for (PMDataManager *PM : PassManagers)
PM->dumpPassArguments();
@@ -878,15 +869,6 @@ void PMDataManager::recordAvailableAnalysis(Pass *P) {
AnalysisID PI = P->getPassID();
AvailableAnalysis[PI] = P;
-
- assert(!AvailableAnalysis.empty());
-
- // This pass is the current implementation of all of the interfaces it
- // implements as well.
- const PassInfo *PInf = TPM->findAnalysisPassInfo(PI);
- if (!PInf) return;
- for (const PassInfo *PI : PInf->getInterfacesImplemented())
- AvailableAnalysis[PI->getTypeInfo()] = P;
}
// Return true if P preserves high level analysis used by other
@@ -1004,20 +986,8 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
P->releaseMemory();
}
- AnalysisID PI = P->getPassID();
- if (const PassInfo *PInf = TPM->findAnalysisPassInfo(PI)) {
- // Remove the pass itself (if it is not already removed).
- AvailableAnalysis.erase(PI);
-
- // Remove all interfaces this pass implements, for which it is also
- // listed as the available implementation.
- for (const PassInfo *PI : PInf->getInterfacesImplemented()) {
- DenseMap<AnalysisID, Pass *>::iterator Pos =
- AvailableAnalysis.find(PI->getTypeInfo());
- if (Pos != AvailableAnalysis.end() && Pos->second == P)
- AvailableAnalysis.erase(Pos);
- }
- }
+ // Remove the pass itself (if it is not already removed).
+ AvailableAnalysis.erase(P->getPassID());
}
/// Add pass P into the PassVector. Update
@@ -1173,11 +1143,8 @@ void PMDataManager::dumpPassArguments() const {
for (Pass *P : PassVector) {
if (PMDataManager *PMD = P->getAsPMDataManager())
PMD->dumpPassArguments();
- else
- if (const PassInfo *PI =
- TPM->findAnalysisPassInfo(P->getPassID()))
- if (!PI->isAnalysisGroup())
- dbgs() << " -" << PI->getPassArgument();
+ else if (const PassInfo *PI = TPM->findAnalysisPassInfo(P->getPassID()))
+ dbgs() << " -" << PI->getPassArgument();
}
}
@@ -1416,8 +1383,7 @@ bool FPPassManager::runOnFunction(Function &F) {
// Store name outside of loop to avoid redundant calls.
const StringRef Name = F.getName();
- llvm::TimeTraceScope FunctionScope(
- "OptFunction", [&F]() { return demangle(F.getName().str()); });
+ llvm::TimeTraceScope FunctionScope("OptFunction", Name);
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
FunctionPass *FP = getContainedPass(Index);