summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LCSSA.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-05-26 10:07:43 +0000
committerOwen Anderson <resistor@mac.com>2008-05-26 10:07:43 +0000
commitd3f21d165f89eae9021d1f3026455754233ce6db (patch)
tree70f4506bb3cb6501fd0b864e109bfacd5854abac /llvm/lib/Transforms/Utils/LCSSA.cpp
parent2e8c82893bc31cabe97d5f2732b1543e0c17b86e (diff)
downloadbcm5719-llvm-d3f21d165f89eae9021d1f3026455754233ce6db.tar.gz
bcm5719-llvm-d3f21d165f89eae9021d1f3026455754233ce6db.zip
Use a DenseMap instead of an std::map, speeding up the testcase in PR2368 by about a third.
llvm-svn: 51565
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LCSSA.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp
index 316784d3bef..6277265a36f 100644
--- a/llvm/lib/Transforms/Utils/LCSSA.cpp
+++ b/llvm/lib/Transforms/Utils/LCSSA.cpp
@@ -87,7 +87,7 @@ namespace {
SetVector<Instruction*> &AffectedValues);
Value *GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
- std::map<DomTreeNode*, Value*> &Phis);
+ DenseMap<DomTreeNode*, Value*> &Phis);
/// inLoop - returns true if the given block is within the current loop
bool inLoop(BasicBlock* B) {
@@ -143,7 +143,7 @@ void LCSSA::ProcessInstruction(Instruction *Instr,
++NumLCSSA; // We are applying the transformation
// Keep track of the blocks that have the value available already.
- std::map<DomTreeNode*, Value*> Phis;
+ DenseMap<DomTreeNode*, Value*> Phis;
DomTreeNode *InstrNode = DT->getNode(Instr->getParent());
@@ -247,7 +247,7 @@ void LCSSA::getLoopValuesUsedOutsideLoop(Loop *L,
/// GetValueForBlock - Get the value to use within the specified basic block.
/// available values are in Phis.
Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst,
- std::map<DomTreeNode*, Value*> &Phis) {
+ DenseMap<DomTreeNode*, Value*> &Phis) {
// If there is no dominator info for this BB, it is unreachable.
if (BB == 0)
return UndefValue::get(OrigInst->getType());
OpenPOWER on IntegriCloud