[llvm-commits] [poolalloc] r112150 - /poolalloc/trunk/lib/DSA/BottomUpClosure.cpp

Will Dietz wdietz2 at illinois.edu
Wed Aug 25 19:26:30 PDT 2010


Author: wdietz2
Date: Wed Aug 25 21:26:30 2010
New Revision: 112150

URL: http://llvm.org/viewvc/llvm-project?rev=112150&view=rev
Log:
Fixed bug where BU used the callgraph to discover callees for inlining.
This was an artifact from the work on partial inlining (see r98921), and enabled
situations where BU would try to inline the graph for an unvisited function.
(Which can easily result in all kinds of badness)

This fixes the infinite recursion in calculateGraph triggered by sqlite3.

Finally, I believe this means we can also remove the eraseCS stuff, since if we
get callees for a site it is because we are able to resolve it (and so should
remove it).  Will visit this later, I believe present behavior isn't *wrong*.

Modified:
    poolalloc/trunk/lib/DSA/BottomUpClosure.cpp

Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=112150&r1=112149&r2=112150&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Wed Aug 25 21:26:30 2010
@@ -691,23 +691,11 @@
       continue;
     }
 
-    //
-    // Find all called functions called by this call site.  Remove from the
-    // list all calls to external functions (functions with no bodies).
-    //
+    // Find all callees for this callsite, according to the DSGraph!
+    // Do *not* use the callgraph, because we're updating that as we go!
     std::vector<const Function*> CalledFuncs;
-    {
-      // Get the callees from the callgraph
-      std::copy(callgraph.callee_begin(CS.getCallSite()),
-                callgraph.callee_end(CS.getCallSite()),
-                std::back_inserter(CalledFuncs));
-
-      // Remove calls to external functions
-      std::vector<const Function*>::iterator ErasePoint =
-              std::remove_if(CalledFuncs.begin(), CalledFuncs.end(),
-                             std::mem_fun(&Function::isDeclaration));
-      CalledFuncs.erase(ErasePoint, CalledFuncs.end());
-    }
+    getAllCallees(CS,CalledFuncs);
+
 
     if (CalledFuncs.empty()) {
       ++NumEmptyCalls;





More information about the llvm-commits mailing list