[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CompleteBottomUp.cpp EquivClassGraphs.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Mar 18 15:20:02 PST 2005



Changes in directory llvm/lib/Analysis/DataStructure:

BottomUpClosure.cpp updated: 1.97 -> 1.98
CompleteBottomUp.cpp updated: 1.21 -> 1.22
EquivClassGraphs.cpp updated: 1.32 -> 1.33
---
Log message:

do not bother inlining nullary functions without return values.  The only 
effect these calls can have is due to global variables, and these passes
all use the globals graph to capture their effect anyway.  This speeds up
the BU pass very slightly on perlbmk, reducing the number of dsnodes 
allocated from 98913 to 96423.


---
Diffs of the changes:  (+15 -1)

 BottomUpClosure.cpp  |    7 +++++++
 CompleteBottomUp.cpp |    6 +++++-
 EquivClassGraphs.cpp |    3 +++
 3 files changed, 15 insertions(+), 1 deletion(-)


Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.97 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.98
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.97	Tue Mar 15 16:10:04 2005
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp	Fri Mar 18 17:19:47 2005
@@ -305,6 +305,13 @@
 
     CalledFuncs.clear();
 
+    // Fast path for noop calls.  Note that we don't care about merging globals
+    // in the callee with nodes in the caller here.
+    if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0) {
+      TempFCs.erase(TempFCs.begin());
+      continue;
+    }
+
     if (CS.isDirectCall()) {
       Function *F = CS.getCalleeFunc();
       if (isResolvableFunc(F))


Index: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
diff -u llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.21 llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.22
--- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.21	Tue Mar 15 16:10:04 2005
+++ llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp	Fri Mar 18 17:19:47 2005
@@ -217,7 +217,11 @@
 
     assert(calls.insert(TheCall).second &&
            "Call instruction occurs multiple times in graph??");
-      
+    
+    // Fast path for noop calls.  Note that we don't care about merging globals
+    // in the callee with nodes in the caller here.
+    if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0)
+      continue;
 
     // Loop over all of the potentially called functions...
     // Inline direct calls as well as indirect calls because the direct


Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.32 llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.33
--- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.32	Tue Mar 15 16:47:18 2005
+++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp	Fri Mar 18 17:19:47 2005
@@ -406,6 +406,9 @@
     assert(calls.insert(TheCall).second &&
            "Call instruction occurs multiple times in graph??");
     
+    if (CS.getRetVal().isNull() && CS.getNumPtrArgs() == 0)
+      continue;
+
     // Inline the common callee graph into the current graph, if the callee
     // graph has not changed.  Note that all callees should have the same
     // graph so we only need to do this once.






More information about the llvm-commits mailing list