[llvm-commits] CVS: poolalloc/lib/PoolAllocate/PoolAllocate.cpp PoolAllocate.h
Chris Lattner
lattner at cs.uiuc.edu
Tue Feb 8 16:10:06 PST 2005
Changes in directory poolalloc/lib/PoolAllocate:
PoolAllocate.cpp updated: 1.100 -> 1.101
PoolAllocate.h updated: 1.37 -> 1.38
---
Log message:
Keep track of the nodes that are locally pool allocated into a function.
Fix bug in getFuncInfoOrClone.
---
Diffs of the changes: (+11 -8)
Index: poolalloc/lib/PoolAllocate/PoolAllocate.cpp
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.100 poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.101
--- poolalloc/lib/PoolAllocate/PoolAllocate.cpp:1.100 Tue Feb 8 17:46:34 2005
+++ poolalloc/lib/PoolAllocate/PoolAllocate.cpp Tue Feb 8 18:09:56 2005
@@ -540,7 +540,6 @@
// Loop over all of the nodes which are non-escaping, adding pool-allocatable
// ones to the NodesToPA vector.
- std::vector<const DSNode*> NodesToPA;
for (DSGraph::node_iterator I = G.node_begin(), E = G.node_end(); I != E;++I){
// We only need to make a pool if there is a heap object in it...
DSNode *N = *I;
@@ -554,14 +553,14 @@
// Otherwise, if it was not passed in from outside the function, it must
// be a local pool!
assert(!N->isGlobalNode() && "Should be in global mapping!");
- NodesToPA.push_back(N);
+ FI.NodesToPA.push_back(N);
}
}
- if (!NodesToPA.empty()) {
- std::cerr << "[" << F.getName() << "] " << NodesToPA.size()
+ if (!FI.NodesToPA.empty()) {
+ std::cerr << "[" << F.getName() << "] " << FI.NodesToPA.size()
<< " nodes pool allocatable\n";
- CreatePools(NewF, NodesToPA, FI.PoolDescriptors);
+ CreatePools(NewF, FI.NodesToPA, FI.PoolDescriptors);
} else {
DEBUG(std::cerr << "[" << F.getName() << "] transforming body.\n");
}
@@ -573,8 +572,8 @@
TransformBody(G, FI, PoolUses, PoolFrees, NewF);
// Create pool construction/destruction code
- if (!NodesToPA.empty())
- InitializeAndDestroyPools(NewF, NodesToPA, FI.PoolDescriptors,
+ if (!FI.NodesToPA.empty())
+ InitializeAndDestroyPools(NewF, FI.NodesToPA, FI.PoolDescriptors,
PoolUses, PoolFrees);
CurHeuristic->HackFunctionBody(NewF, FI.PoolDescriptors);
}
Index: poolalloc/lib/PoolAllocate/PoolAllocate.h
diff -u poolalloc/lib/PoolAllocate/PoolAllocate.h:1.37 poolalloc/lib/PoolAllocate/PoolAllocate.h:1.38
--- poolalloc/lib/PoolAllocate/PoolAllocate.h:1.37 Tue Feb 8 17:47:51 2005
+++ poolalloc/lib/PoolAllocate/PoolAllocate.h Tue Feb 8 18:09:56 2005
@@ -63,6 +63,10 @@
///
std::vector<const DSNode*> ArgNodes;
+ /// NodesToPA - The list of nodes which are to be pool allocated locally in
+ /// this function. This only includes heap nodes.
+ std::vector<const DSNode*> NodesToPA;
+
/// PoolDescriptors - The Value* (either an argument or an alloca) which
/// defines the pool descriptor for this DSNode. Pools are mapped one to
/// one with nodes in the DSGraph, so this contains a pointer to the node it
@@ -138,7 +142,7 @@
return FI;
// Maybe this is a function clone?
if (Function *FC = getOrigFunctionFromClone(&F))
- return getFuncInfo(F);
+ return getFuncInfo(*FC);
return 0;
}
More information about the llvm-commits
mailing list