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

Chris Lattner lattner at cs.uiuc.edu
Wed Mar 9 08:30:05 PST 2005



Changes in directory llvm/lib/Analysis:

BasicAliasAnalysis.cpp updated: 1.64 -> 1.65
---
Log message:

Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis!


---
Diffs of the changes:  (+6 -2)

 BasicAliasAnalysis.cpp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)


Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff -u llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.64 llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.65
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp:1.64	Sat Jan  8 16:01:16 2005
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp	Wed Mar  9 10:29:52 2005
@@ -307,7 +307,9 @@
     if (!isa<Argument>(O1) && isa<ConstantPointerNull>(V2))
       return NoAlias;                    // Unique values don't alias null
 
-    if (isa<GlobalVariable>(O1) || isa<AllocationInst>(O1))
+    if (isa<GlobalVariable>(O1) || 
+        (isa<AllocationInst>(O1) &&
+         !cast<AllocationInst>(O1)->isArrayAllocation()))
       if (cast<PointerType>(O1->getType())->getElementType()->isSized()) {
         // If the size of the other access is larger than the total size of the
         // global/alloca/malloc, it cannot be accessing the global (it's
@@ -323,7 +325,9 @@
     if (!isa<Argument>(O2) && isa<ConstantPointerNull>(V1))
       return NoAlias;                    // Unique values don't alias null
 
-    if (isa<GlobalVariable>(O2) || isa<AllocationInst>(O2))
+    if (isa<GlobalVariable>(O2) ||
+        (isa<AllocationInst>(O2) &&
+         !cast<AllocationInst>(O2)->isArrayAllocation()))
       if (cast<PointerType>(O2->getType())->getElementType()->isSized()) {
         // If the size of the other access is larger than the total size of the
         // global/alloca/malloc, it cannot be accessing the object (it's






More information about the llvm-commits mailing list