summaryrefslogtreecommitdiffstats
path: root/llvm/lib
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
commit562c1808791dcea9ce7f625ee28a21cc63bc8bc6 (patch)
tree41f4ed2a0bbd243218169ff2244c1b808a1847ba /llvm/lib
parent623bb75d357e9fce3922018e59902b8807764e5c (diff)
downloadbcm5719-llvm-562c1808791dcea9ce7f625ee28a21cc63bc8bc6.tar.gz
bcm5719-llvm-562c1808791dcea9ce7f625ee28a21cc63bc8bc6.zip
Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation
that Alkis found with Java, thanks Alkis! llvm-svn: 20531
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index c50758541ed..98508a8c14c 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud