[llvm-commits] [poolalloc] r123366 - /poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Wed Jan 12 21:51:13 PST 2011
Author: aggarwa4
Date: Wed Jan 12 23:51:13 2011
New Revision: 123366
URL: http://llvm.org/viewvc/llvm-project?rev=123366&view=rev
Log:
We must assume that any heap pointer that is cast to
int, can escape and hence, must be allocated a global
pool.
Modified:
poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp?rev=123366&r1=123365&r2=123366&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp Wed Jan 12 23:51:13 2011
@@ -73,7 +73,7 @@
// Remove those global nodes which we know will never be pool allocated.
//
- /*std::vector<const DSNode *> toRemove;
+ std::vector<const DSNode *> toRemove;
for (DenseSet<const DSNode*>::iterator I = NodesFromGlobals.begin(),
E = NodesFromGlobals.end(); I != E; ) {
DenseSet<const DSNode*>::iterator Last = I; ++I;
@@ -92,7 +92,7 @@
//
for (unsigned index = 0; index < toRemove.size(); ++index) {
NodesFromGlobals.erase(toRemove[index]);
- }*/
+ }
//
// Now the fun part. Find DSNodes in the local graph that correspond to
@@ -182,9 +182,15 @@
//assert (!GGN || GlobalHeapNodes.count (GGN));
if (GGN && GlobalHeapNodes.count (GGN))
PoolMap[GGN].NodesInPool.push_back (N);
+ else if (N->isHeapNode() && N->isPtrToIntNode()){
+ //FIXME: This is needed to fix failures in 164.gzip and
+ // 197.parser. I am not fully sure this is the right fix.
+ if( !N->isAllocaNode() && !N->isUnknownNode()) {
+ PoolMap[N]= OnePool(N);
+ GlobalHeapNodes.insert(N);
+ }
+ }
}
-
-
}
}
@@ -239,7 +245,6 @@
ResultPools.push_back(PoolMap[NodesToPA[i]]);
else
ResultPools.push_back (OnePool(NodesToPA[i]));
-// ResultPools.push_back(OnePool(NodesToPA[i]));
}
}
More information about the llvm-commits
mailing list