summaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-15 06:28:07 +0000
committerChris Lattner <sabre@nondot.org>2004-03-15 06:28:07 +0000
commitfcead4f4266d2e944fd3f8a82f24aed21c481eb5 (patch)
treed90707f9dd1146698efe482e1c3dae03b101d359 /lib/Analysis/AliasSetTracker.cpp
parentdf209fcc7e04a474ad8d572e4c7e21ce1c944334 (diff)
downloadllvm-fcead4f4266d2e944fd3f8a82f24aed21c481eb5.tar.gz
llvm-fcead4f4266d2e944fd3f8a82f24aed21c481eb5.tar.bz2
llvm-fcead4f4266d2e944fd3f8a82f24aed21c481eb5.tar.xz
Ok, the assertion was bogus. Calls that do not read/write memory should not
have an alias set, just like adds and subtracts don't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--lib/Analysis/AliasSetTracker.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp
index 450ba935bc..0fb419266c 100644
--- a/lib/Analysis/AliasSetTracker.cpp
+++ b/lib/Analysis/AliasSetTracker.cpp
@@ -117,6 +117,8 @@ void AliasSet::addCallSite(CallSite CS, AliasAnalysis &AA) {
bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size,
AliasAnalysis &AA) const {
if (AliasTy == MustAlias) {
+ assert(CallSites.empty() && "Illegal must alias set!");
+
// If this is a set of MustAliases, only check to see if the pointer aliases
// SOME value in the set...
HashNodePair *SomePtr = getSomePointer();
@@ -222,6 +224,10 @@ void AliasSetTracker::add(StoreInst *SI) {
void AliasSetTracker::add(CallSite CS) {
+ if (Function *F = CS.getCalledFunction())
+ if (AA.doesNotAccessMemory(F))
+ return;
+
AliasSet *AS = findAliasSetForCallSite(CS);
if (!AS) {
AliasSets.push_back(AliasSet());