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

Misha Brukman brukman at cs.uiuc.edu
Wed Dec 11 23:35:01 PST 2002


Changes in directory llvm/lib/Analysis/DataStructure:

Steensgaard.cpp updated: 1.13 -> 1.14

---
Log message:

'graph' is spelled without a 'c'.
Also added Statistic counters for NoAlias and MayAlias.


---
Diffs of the changes:

Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.13 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.14
--- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.13	Sat Nov  9 16:06:59 2002
+++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp	Wed Dec 11 23:34:10 2002
@@ -14,6 +14,11 @@
 #include "Support/Statistic.h"
 
 namespace {
+  Statistic<> NumNoAlias  ("steens", "Number of 'no alias' replies");
+  Statistic<> NumMayAlias ("steens", "Number of 'may alias' replies");
+};
+
+namespace {
   class Steens : public Pass, public AliasAnalysis {
     DSGraph *ResultGraph;
   public:
@@ -202,7 +207,7 @@
 
 // alias - This is the only method here that does anything interesting...
 AliasAnalysis::Result Steens::alias(const Value *V1, const Value *V2) {
-  assert(ResultGraph && "Result grcaph has not yet been computed!");
+  assert(ResultGraph && "Result graph has not been computed yet!");
 
   std::map<Value*, DSNodeHandle> &GVM = ResultGraph->getScalarMap();
 
@@ -214,9 +219,10 @@
       DSNodeHandle &V2H = J->second;
       // If the two pointers point to different data structure graph nodes, they
       // cannot alias!
-      if (V1H.getNode() != V2H.getNode())
+      if (V1H.getNode() != V2H.getNode()) {
+        ++NumNoAlias;
         return NoAlias;
-
+      }
       // FIXME: If the two pointers point to the same node, and the offsets are
       // different, and the LinkIndex vector doesn't alias the section, then the
       // two pointers do not alias.  We need access size information for the two
@@ -224,6 +230,9 @@
       //
     }
   }
+
+  // Since Steensgaard cannot do any better, count it as a 'may alias'
+  ++NumMayAlias;
 
   // If we cannot determine alias properties based on our graph, fall back on
   // some other AA implementation.





More information about the llvm-commits mailing list