summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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());