[llvm-commits] [llvm] r51565 - /llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
Owen Anderson
resistor at mac.com
Mon May 26 03:07:44 PDT 2008
Author: resistor
Date: Mon May 26 05:07:43 2008
New Revision: 51565
URL: http://llvm.org/viewvc/llvm-project?rev=51565&view=rev
Log:
Use a DenseMap instead of an std::map, speeding up the testcase in PR2368 by about a third.
Modified:
llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=51565&r1=51564&r2=51565&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Mon May 26 05:07:43 2008
@@ -87,7 +87,7 @@
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 @@
++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 @@
/// 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());
More information about the llvm-commits
mailing list