summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-06-04 06:50:18 +0000
committerDan Gohman <gohman@apple.com>2011-06-04 06:50:18 +0000
commitadf80ae9e458593c1b27c8674fff997c4ba0c216 (patch)
treee9ffd88ee56e791022c4e0ef202ac2cf7f701004 /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parenta471751c24324e7ba6ac5c612dbedb16c644fc44 (diff)
downloadbcm5719-llvm-adf80ae9e458593c1b27c8674fff997c4ba0c216.tar.gz
bcm5719-llvm-adf80ae9e458593c1b27c8674fff997c4ba0c216.zip
Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled. llvm-svn: 132632
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 24297d4a0f3..3d10a5fd4d7 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud