aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-09 16:29:52 +0000
committerChris Lattner <sabre@nondot.org>2005-03-09 16:29:52 +0000
commit50bc9ef507090176773aa323e4d2d9413cc9d223 (patch)
tree8ab34131b1eebe4be768ed50593b620ea5833684 /lib/Analysis/BasicAliasAnalysis.cpp
parent465e24ba2041d22f1ca992bf39fde14b988f3f72 (diff)
Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index c50758541e..98508a8c14 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -307,7 +307,9 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
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 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
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