diff options
author | Dan Gohman <gohman@apple.com> | 2011-06-04 06:50:18 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2011-06-04 06:50:18 +0000 |
commit | 5f1312c36e811562c3ea3136332771aed98016ed (patch) | |
tree | 1ab45011b26a53cdefb865c2ee03739480a703a0 /lib | |
parent | a3351a0e5db0b5b2c53920f2f15d3e862fecfad3 (diff) |
Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 24297d4a0f..3d10a5fd4d 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -944,7 +944,17 @@ BasicAliasAnalysis::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size, 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 |