[llvm-commits] [poolalloc] r117590 - /poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
John Criswell
criswell at uiuc.edu
Thu Oct 28 12:56:26 PDT 2010
Author: criswell
Date: Thu Oct 28 14:56:26 2010
New Revision: 117590
URL: http://llvm.org/viewvc/llvm-project?rev=117590&view=rev
Log:
Replaced the old code that decided when to replace passed pools with global
pools. The old code checked for heap object status, which is not a proper
criteria for all poolalloc clients (e.g., SAFECode).
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=117590&r1=117589&r2=117590&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Thu Oct 28 14:56:26 2010
@@ -591,7 +591,7 @@
// DSNodes reachable from globals. DSNodes are *added* to
// this container; it is not cleared by this function.
// DSNodes from both the local and globals graph are added.
-static void
+static inline void
GetNodesReachableFromGlobals (DSGraph* G,
DenseSet<const DSNode*> &NodesFromGlobals) {
//
@@ -747,7 +747,7 @@
return;
//
- // Now find all nodes which are reachable from these DSNodes.
+ // Now find all nodes which are reachable from these argument DSNodes.
//
DenseSet<const DSNode*> MarkedNodes;
for (unsigned index = 0; index < RootNodes.size(); ++index) {
@@ -762,6 +762,14 @@
// reachable from a global, we will create a global pool for it, so no
// argument passage is required.
//
+ if (!PassAllArguments) {
+ std::map<const DSNode*, Value*>::iterator gni;
+ for (gni = GlobalNodes.begin(); gni != GlobalNodes.end(); ++gni) {
+ MarkedNodes.erase(gni->first);
+ }
+ }
+
+#if 0
DenseSet<const DSNode*> NodesFromGlobals;
for (unsigned index = 0; index < Functions.size(); ++index) {
//
@@ -791,6 +799,7 @@
NodesFromGlobals.count(N))
MarkedNodes.erase(N);
}
+#endif
//
// Create new FuncInfo entries for all of the functions. Each one will have
@@ -1171,11 +1180,11 @@
// function.
//
for (unsigned index = 0; index < LocalNodes.size(); ++index) {
- if (!(FI.MarkedNodes.count (LocalNodes[index]))) {
+ if (FI.MarkedNodes.count (LocalNodes[index]) == 0) {
FI.NodesToPA.push_back (LocalNodes[index]);
}
}
-
+
//
// Add code to create the pools that are local to this function.
//
More information about the llvm-commits
mailing list