[llvm-commits] [poolalloc] r123453 - in /poolalloc/trunk/lib/PoolAllocate: AllNodesHeuristic.cpp Heuristic.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Fri Jan 14 11:04:26 PST 2011
Author: aggarwa4
Date: Fri Jan 14 13:04:25 2011
New Revision: 123453
URL: http://llvm.org/viewvc/llvm-project?rev=123453&view=rev
Log:
Do not poolallocate nodes that are marked
PtrToInt. These pointers could escape to external
code.
Modified:
poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp
poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp?rev=123453&r1=123452&r2=123453&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/AllNodesHeuristic.cpp Fri Jan 14 13:04:25 2011
@@ -77,14 +77,14 @@
for (DenseSet<const DSNode*>::iterator I = NodesFromGlobals.begin(),
E = NodesFromGlobals.end(); I != E; ) {
DenseSet<const DSNode*>::iterator Last = I; ++I;
- //
- // Nodes that escape to external code could be reachable from globals.
- // Nodes that are incomplete could be heap nodes.
- // Unknown nodes could be anything.
- //
+
const DSNode *tmp = *Last;
if (!(tmp->isHeapNode()))
toRemove.push_back (tmp);
+ // Do not poolallocate nodes that are cast to Int.
+ // As we do not track through ints, these could be escaping
+ if (tmp->isPtrToIntNode())
+ toRemove.push_back(tmp);
}
//
@@ -182,14 +182,6 @@
//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);
- }
- }
}
}
}
Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=123453&r1=123452&r2=123453&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Fri Jan 14 13:04:25 2011
@@ -429,8 +429,10 @@
if (!(GlobalPoolNodes.count (N) || GlobalPoolNodes.count (GGN))) {
// 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!");
- Nodes.push_back (N);
+ assert(!N->isGlobalNode() || N->isPtrToIntNode() && "Should be in global mapping!");
+ if(!N->isPtrToIntNode()) {
+ Nodes.push_back (N);
+ }
}
}
}
More information about the llvm-commits
mailing list