[llvm-commits] [llvm] r132632 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll
Dan Gohman
gohman at apple.com
Fri Jun 3 23:50:19 PDT 2011
Author: djg
Date: Sat Jun 4 01:50:18 2011
New Revision: 132632
URL: http://llvm.org/viewvc/llvm-project?rev=132632&view=rev
Log:
Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled.
Added:
llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll
- copied unchanged from r132627, llvm/trunk/test/Analysis/TypeBasedAliasAnalysis/dynamic-indices.ll
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=132632&r1=132631&r2=132632&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Sat Jun 4 01:50:18 2011
@@ -944,7 +944,17 @@
return NoAlias;
}
- return MayAlias;
+ // Statically, we can see that the base objects are the same, but the
+ // pointers have dynamic offsets which we can't resolve. And none of our
+ // little tricks above worked.
+ //
+ // TODO: Returning PartialAlias instead of MayAlias is a mild hack; the
+ // practical effect of this is protecting TBAA in the case of dynamic
+ // indices into arrays of unions. An alternative way to solve this would
+ // be to have clang emit extra metadata for unions and/or union accesses.
+ // A union-specific solution wouldn't handle the problem for malloc'd
+ // memory however.
+ return PartialAlias;
}
static AliasAnalysis::AliasResult
Modified: llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll?rev=132632&r1=132631&r2=132632&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll (original)
+++ llvm/trunk/test/Analysis/BasicAA/2010-09-15-GEP-SignedArithmetic.ll Sat Jun 4 01:50:18 2011
@@ -1,4 +1,4 @@
-; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {1 may alias}
+; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {1 partial alias}
; PR7959
target datalayout = "e-p:32:32:32"
More information about the llvm-commits
mailing list