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

Alkis Evlogimenos alkis at cs.uiuc.edu
Wed Dec 8 15:42:22 PST 2004



Changes in directory llvm/lib/Analysis:

BasicAliasAnalysis.cpp updated: 1.59 -> 1.60
---
Log message:

Add testcase and fix for another case where we query the size an
abstract type.


---
Diffs of the changes:  (+12 -7)

Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.59 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.60
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.59	Tue Dec  7 02:11:24 2004
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp	Wed Dec  8 17:42:11 2004
@@ -410,13 +410,18 @@
           // the size of the argument... build an index vector that is equal to
           // the arguments provided, except substitute 0's for any variable
           // indexes we find...
-          for (unsigned i = 0; i != GEPOperands.size(); ++i)
-            if (!isa<ConstantInt>(GEPOperands[i]))
-              GEPOperands[i] =Constant::getNullValue(GEPOperands[i]->getType());
-          int64_t Offset = getTargetData().getIndexedOffset(BasePtr->getType(),
-                                                            GEPOperands);
-          if (Offset >= (int64_t)V2Size || Offset <= -(int64_t)V1Size)
-            return NoAlias;
+          if (cast<PointerType>(
+                BasePtr->getType())->getElementType()->isSized()) {
+            for (unsigned i = 0; i != GEPOperands.size(); ++i)
+              if (!isa<ConstantInt>(GEPOperands[i]))
+                GEPOperands[i] =
+                  Constant::getNullValue(GEPOperands[i]->getType());
+            int64_t Offset =
+              getTargetData().getIndexedOffset(BasePtr->getType(), GEPOperands);
+
+            if (Offset >= (int64_t)V2Size || Offset <= -(int64_t)V1Size)
+              return NoAlias;
+          }
         }
       }
     }






More information about the llvm-commits mailing list