[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Steensgaard.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Mar 27 13:57:39 PST 2005



Changes in directory llvm/lib/Analysis/DataStructure:

Steensgaard.cpp updated: 1.57 -> 1.58
---
Log message:

speed up steens by using spliceFrom, improve its precision by realizing that
an incomplete node cannot alias a complete node.


---
Diffs of the changes:  (+10 -5)

 Steensgaard.cpp |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)


Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.57 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.58
--- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.57	Sat Mar 26 16:43:20 2005
+++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp	Sun Mar 27 15:56:55 2005
@@ -124,7 +124,7 @@
   //
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal())
-      ResultGraph->cloneInto(LDS.getDSGraph(*I));
+      ResultGraph->spliceFrom(LDS.getDSGraph(*I));
 
   ResultGraph->removeTriviallyDeadNodes();
 
@@ -191,13 +191,18 @@
   DSGraph::ScalarMapTy &GSM = ResultGraph->getScalarMap();
 
   DSGraph::ScalarMapTy::iterator I = GSM.find(const_cast<Value*>(V1));
+  DSGraph::ScalarMapTy::iterator J = GSM.find(const_cast<Value*>(V2));
   if (I != GSM.end() && !I->second.isNull() &&
-      I->second.getNode()->isComplete()) {
+      J != GSM.end() && !J->second.isNull()) {
     DSNodeHandle &V1H = I->second;
-    DSGraph::ScalarMapTy::iterator J=GSM.find(const_cast<Value*>(V2));
-    if (J != GSM.end() && !J->second.isNull() &&
+    DSNodeHandle &V2H = J->second;
+
+    // If at least one of the nodes is complete, we can say something about
+    // this.  If one is complete and the other isn't, then they are obviously
+    // different nodes.  If they are both complete, we can't say anything
+    // useful.
+    if (I->second.getNode()->isComplete() ||
         J->second.getNode()->isComplete()) {
-      DSNodeHandle &V2H = J->second;
       // If the two pointers point to different data structure graph nodes, they
       // cannot alias!
       if (V1H.getNode() != V2H.getNode())






More information about the llvm-commits mailing list