From 562c1808791dcea9ce7f625ee28a21cc63bc8bc6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 9 Mar 2005 16:29:52 +0000 Subject: [PATCH] Fix Regression/Analysis/BasicAA/2005-03-09-BrokenBasicAA.ll, a miscompilation that Alkis found with Java, thanks Alkis! llvm-svn: 20531 --- llvm/lib/Analysis/BasicAliasAnalysis.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index c50758541ed6..98508a8c14c9 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(O1) && isa(V2)) return NoAlias; // Unique values don't alias null - if (isa(O1) || isa(O1)) + if (isa(O1) || + (isa(O1) && + !cast(O1)->isArrayAllocation())) if (cast(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(O2) && isa(V1)) return NoAlias; // Unique values don't alias null - if (isa(O2) || isa(O2)) + if (isa(O2) || + (isa(O2) && + !cast(O2)->isArrayAllocation())) if (cast(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