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

Chris Lattner lattner at cs.uiuc.edu
Tue Jul 1 23:40:26 PDT 2003


Changes in directory llvm/lib/Analysis/DataStructure:

DataStructureAA.cpp updated: 1.7 -> 1.8

---
Log message:

Reduce amount of work we do calculating mustaliases if the arg is a global


---
Diffs of the changes:

Index: llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.7 llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.8
--- llvm/lib/Analysis/DataStructure/DataStructureAA.cpp:1.7	Sat Jun 28 19:54:08 2003
+++ llvm/lib/Analysis/DataStructure/DataStructureAA.cpp	Tue Jul  1 23:39:13 2003
@@ -146,17 +146,22 @@
 /// specified vector.
 ///
 void DSAA::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
-  DSGraph *G = getGraphForValue(P);
-  if (!G) G = &TD->getGlobalsGraph();
-  
-  // The only must alias information we can currently determine occurs when the
-  // node for P is a global node with only one entry.
-  const DSGraph::ScalarMapTy &GSM = G->getScalarMap();
-  DSGraph::ScalarMapTy::const_iterator I = GSM.find(P);
-  if (I != GSM.end()) {
-    DSNode *N = I->second.getNode();
-    if (isSinglePhysicalObject(N))
-      RetVals.push_back(N->getGlobals()[0]);
+  // Currently the only must alias information we can provide is to say that
+  // something is equal to a global value. If we already have a global value,
+  // don't get worked up about it.
+  if (!isa<GlobalValue>(P)) {
+    DSGraph *G = getGraphForValue(P);
+    if (!G) G = &TD->getGlobalsGraph();
+    
+    // The only must alias information we can currently determine occurs when
+    // the node for P is a global node with only one entry.
+    const DSGraph::ScalarMapTy &GSM = G->getScalarMap();
+    DSGraph::ScalarMapTy::const_iterator I = GSM.find(P);
+    if (I != GSM.end()) {
+      DSNode *N = I->second.getNode();
+      if (N->isComplete() && isSinglePhysicalObject(N))
+        RetVals.push_back(N->getGlobals()[0]);
+    }
   }
 
   return getAnalysis<AliasAnalysis>().getMustAliases(P, RetVals);





More information about the llvm-commits mailing list