[llvm-commits] CVS: llvm/lib/Transforms/IPO/PoolAllocate.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jan 31 22:53:01 PST 2003
Changes in directory llvm/lib/Transforms/IPO:
PoolAllocate.cpp updated: 1.1 -> 1.2
---
Log message:
Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
This change provides a small (3%) but consistent speedup
---
Diffs of the changes:
Index: llvm/lib/Transforms/IPO/PoolAllocate.cpp
diff -u llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.1 llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.2
--- llvm/lib/Transforms/IPO/PoolAllocate.cpp:1.1 Wed Jan 29 15:12:13 2003
+++ llvm/lib/Transforms/IPO/PoolAllocate.cpp Fri Jan 31 22:52:08 2003
@@ -43,7 +43,7 @@
/// MarkedNodes - The set of nodes which are not locally pool allocatable in
/// the current function.
///
- std::set<DSNode*> MarkedNodes;
+ hash_set<DSNode*> MarkedNodes;
/// Clone - The cloned version of the function, if applicable.
Function *Clone;
@@ -204,7 +204,7 @@
// Find DataStructure nodes which are allocated in pools non-local to the
// current function. This set will contain all of the DSNodes which require
// pools to be passed in from outside of the function.
- std::set<DSNode*> &MarkedNodes = FI.MarkedNodes;
+ hash_set<DSNode*> &MarkedNodes = FI.MarkedNodes;
// Mark globals and incomplete nodes as live... (this handles arguments)
if (F.getName() != "main")
@@ -225,7 +225,7 @@
ArgTys.reserve(OldFuncTy->getParamTypes().size() + MarkedNodes.size());
FI.ArgNodes.reserve(MarkedNodes.size());
- for (std::set<DSNode*>::iterator I = MarkedNodes.begin(),
+ for (hash_set<DSNode*>::iterator I = MarkedNodes.begin(),
E = MarkedNodes.end(); I != E; ++I)
if ((*I)->NodeType & DSNode::Incomplete) {
ArgTys.push_back(PoolDescPtr); // Add the appropriate # of pool descs
@@ -289,7 +289,7 @@
if (Nodes.empty()) return; // Quick exit if nothing to do...
FuncInfo &FI = FunctionInfo[&F]; // Get FuncInfo for F
- std::set<DSNode*> &MarkedNodes = FI.MarkedNodes;
+ hash_set<DSNode*> &MarkedNodes = FI.MarkedNodes;
DEBUG(std::cerr << "[" << F.getName() << "] Pool Allocate: ");
@@ -414,8 +414,8 @@
// Remove old malloc instruction
MI.getParent()->getInstList().erase(&MI);
- std::map<Value*, DSNodeHandle> &SM = G.getScalarMap();
- std::map<Value*, DSNodeHandle>::iterator MII = SM.find(&MI);
+ hash_map<Value*, DSNodeHandle> &SM = G.getScalarMap();
+ hash_map<Value*, DSNodeHandle>::iterator MII = SM.find(&MI);
// If we are modifying the original function, update the DSGraph...
if (MII != SM.end()) {
More information about the llvm-commits
mailing list