diff options
author | Chris Lattner <sabre@nondot.org> | 2013-10-14 16:05:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2013-10-14 16:05:55 +0000 |
commit | 2a6cbba2db261d2ee29a1373e195f95fd232e61b (patch) | |
tree | e911b96ceb99f5d8b25fb20508a70a812191f7f7 /lib/Transforms | |
parent | 95864303f5054c68043febc861764070e8f13913 (diff) | |
download | external_llvm-2a6cbba2db261d2ee29a1373e195f95fd232e61b.zip external_llvm-2a6cbba2db261d2ee29a1373e195f95fd232e61b.tar.gz external_llvm-2a6cbba2db261d2ee29a1373e195f95fd232e61b.tar.bz2 |
Basic blocks typically have few predecessors. Use a SmallDenseMap to
avoid a heap allocation when this is the case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Utils/SSAUpdater.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp index fc85ef3..30adbfa 100644 --- a/lib/Transforms/Utils/SSAUpdater.cpp +++ b/lib/Transforms/Utils/SSAUpdater.cpp @@ -63,7 +63,7 @@ void SSAUpdater::AddAvailableValue(BasicBlock *BB, Value *V) { } static bool IsEquivalentPHI(PHINode *PHI, - DenseMap<BasicBlock*, Value*> &ValueMapping) { + SmallDenseMap<BasicBlock*, Value*, 8> &ValueMapping) { unsigned PHINumValues = PHI->getNumIncomingValues(); if (PHINumValues != ValueMapping.size()) return false; @@ -136,8 +136,8 @@ Value *SSAUpdater::GetValueInMiddleOfBlock(BasicBlock *BB) { // Otherwise, we do need a PHI: check to see if we already have one available // in this block that produces the right value. if (isa<PHINode>(BB->begin())) { - DenseMap<BasicBlock*, Value*> ValueMapping(PredValues.begin(), - PredValues.end()); + SmallDenseMap<BasicBlock*, Value*, 8> ValueMapping(PredValues.begin(), + PredValues.end()); PHINode *SomePHI; for (BasicBlock::iterator It = BB->begin(); (SomePHI = dyn_cast<PHINode>(It)); ++It) { |