aboutsummaryrefslogtreecommitdiff
path: root/lib/IR/PassManager.cpp
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2013-02-26 01:31:59 +0000
committerMichael Ilseman <milseman@apple.com>2013-02-26 01:31:59 +0000
commitce522ee0a27062390f13e7ccb53fcff4fc36c473 (patch)
treed8d9d373d0ac48564123f90d8bc19cfa226c6d8f /lib/IR/PassManager.cpp
parent70cdcd5114b30c4983ff158278422ea129bd27bb (diff)
Use a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the pass-manager overhead from FPPassManager::runOnFunction() by about 10%.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176072 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/PassManager.cpp')
-rw-r--r--lib/IR/PassManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/IR/PassManager.cpp b/lib/IR/PassManager.cpp
index 2bdfd988fa..5a8df703db 100644
--- a/lib/IR/PassManager.cpp
+++ b/lib/IR/PassManager.cpp
@@ -874,9 +874,9 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
return;
const AnalysisUsage::VectorType &PreservedSet = AnUsage->getPreservedSet();
- for (std::map<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
+ for (DenseMap<AnalysisID, Pass*>::iterator I = AvailableAnalysis.begin(),
E = AvailableAnalysis.end(); I != E; ) {
- std::map<AnalysisID, Pass*>::iterator Info = I++;
+ DenseMap<AnalysisID, Pass*>::iterator Info = I++;
if (Info->second->getAsImmutablePass() == 0 &&
std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
PreservedSet.end()) {
@@ -897,10 +897,10 @@ void PMDataManager::removeNotPreservedAnalysis(Pass *P) {
if (!InheritedAnalysis[Index])
continue;
- for (std::map<AnalysisID, Pass*>::iterator
+ for (DenseMap<AnalysisID, Pass*>::iterator
I = InheritedAnalysis[Index]->begin(),
E = InheritedAnalysis[Index]->end(); I != E; ) {
- std::map<AnalysisID, Pass *>::iterator Info = I++;
+ DenseMap<AnalysisID, Pass *>::iterator Info = I++;
if (Info->second->getAsImmutablePass() == 0 &&
std::find(PreservedSet.begin(), PreservedSet.end(), Info->first) ==
PreservedSet.end()) {
@@ -960,7 +960,7 @@ void PMDataManager::freePass(Pass *P, StringRef Msg,
// listed as the available implementation.
const std::vector<const PassInfo*> &II = PInf->getInterfacesImplemented();
for (unsigned i = 0, e = II.size(); i != e; ++i) {
- std::map<AnalysisID, Pass*>::iterator Pos =
+ DenseMap<AnalysisID, Pass*>::iterator Pos =
AvailableAnalysis.find(II[i]->getTypeInfo());
if (Pos != AvailableAnalysis.end() && Pos->second == P)
AvailableAnalysis.erase(Pos);
@@ -1100,7 +1100,7 @@ void PMDataManager::initializeAnalysisImpl(Pass *P) {
Pass *PMDataManager::findAnalysisPass(AnalysisID AID, bool SearchParent) {
// Check if AvailableAnalysis map has one entry.
- std::map<AnalysisID, Pass*>::const_iterator I = AvailableAnalysis.find(AID);
+ DenseMap<AnalysisID, Pass*>::const_iterator I = AvailableAnalysis.find(AID);
if (I != AvailableAnalysis.end())
return I->second;