[llvm-commits] [poolalloc] r115321 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
John Criswell
criswell at uiuc.edu
Fri Oct 1 11:08:41 PDT 2010
Author: criswell
Date: Fri Oct 1 13:08:41 2010
New Revision: 115321
URL: http://llvm.org/viewvc/llvm-project?rev=115321&view=rev
Log:
Re-added code that updates a function's set of pool descriptors with global
pool descriptors. The PoolDescriptors map in the FuncInfo seems to record all
pools used within the function, even if they are not locally-allocated pools.
Modified:
poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=115321&r1=115320&r2=115321&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Fri Oct 1 13:08:41 2010
@@ -1046,10 +1046,45 @@
void
PoolAllocate::ProcessFunctionBody(Function &F, Function &NewF) {
//
- // Ask the heuristic for the list of DSNodes which should get local pools.
+ // Get the DSGraph of the function and the FuncInfo of the function. We'll
+ // need th former and be updatting the latter.
//
DSGraph* G = Graphs->getDSGraph(F);
FuncInfo & FI = *getFuncInfo(F);
+
+ //
+ // Get the mapping between local DSNodes and DSNodes in the globals graph
+ //
+ DSGraph::NodeMapTy GlobalsGraphNodeMapping;
+ G->computeGToGGMapping(GlobalsGraphNodeMapping);
+
+ //
+ // Determine which DSNodes have already been assigned global pools. Record
+ // this information in the function's FuncInfo structure.
+ //
+ for (DSGraph::node_iterator I = G->node_begin(), E = G->node_end();
+ I != E;
+ ++I){
+ // Get the global DSNode matching this DSNode
+ DSNode * N = I;
+
+ // If the local DSNode was assigned a global pool, update the pool
+ // descriptors for the function
+ if (N->isHeapNode() && GlobalNodes[N]) {
+ FI.PoolDescriptors[N] = GlobalNodes[N];
+ }
+
+ // If a corresponding global DSNode was assigned a global pool, update the
+ // pool descriptors for the function
+ DSNode * GGN = GlobalsGraphNodeMapping[N].getNode();
+ if (GGN && GGN->isHeapNode() && GlobalNodes[GGN]) {
+ FI.PoolDescriptors[N] = GlobalNodes[GGN];
+ }
+ }
+
+ //
+ // Ask the heuristic for the list of DSNodes which should get local pools.
+ //
CurHeuristic->getLocalPoolNodes (F, FI.NodesToPA);
//
More information about the llvm-commits
mailing list