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

Chris Lattner lattner at cs.uiuc.edu
Sat Mar 26 14:16:57 PST 2005



Changes in directory llvm/lib/Analysis:

AliasAnalysisEvaluator.cpp updated: 1.23 -> 1.24
---
Log message:

Interchange this loop so that we test all pointers against one call site
before moving on to the next call site.  This will be a more efficient way
to compute the mod/ref set for AA implementations like DSA.


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

 AliasAnalysisEvaluator.cpp |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)


Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.23 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.24
--- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.23	Thu Mar 17 14:25:04 2005
+++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp	Sat Mar 26 16:16:44 2005
@@ -156,15 +156,16 @@
   }
 
   // Mod/ref alias analysis: compare all pairs of calls and values
-  for (std::set<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end();
-       V != Ve; ++V) {
-    unsigned Size = 0;
-    const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType();
-    if (ElTy->isSized()) Size = TD.getTypeSize(ElTy);
-
-    for (std::set<CallSite>::iterator C = CallSites.begin(), 
-           Ce = CallSites.end(); C != Ce; ++C) {
-      Instruction *I = C->getInstruction();
+  for (std::set<CallSite>::iterator C = CallSites.begin(), 
+         Ce = CallSites.end(); C != Ce; ++C) {
+    Instruction *I = C->getInstruction();
+    
+    for (std::set<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end();
+         V != Ve; ++V) {
+      unsigned Size = 0;
+      const Type *ElTy = cast<PointerType>((*V)->getType())->getElementType();
+      if (ElTy->isSized()) Size = TD.getTypeSize(ElTy);
+      
       switch (AA.getModRefInfo(*C, *V, Size)) {
       case AliasAnalysis::NoModRef:
         PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent());
@@ -183,7 +184,7 @@
       }
     }
   }
-
+  
   return false;
 }
 






More information about the llvm-commits mailing list