Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
[oota-llvm.git] / lib / Analysis / AliasSetTracker.cpp
index d266c2a5a07992ecf48363ebb94551edcd883273..303d7987b79e3c46e45cb9b72e0bea89fd655317 100644 (file)
@@ -101,7 +101,7 @@ void AliasSet::addCallSite(CallSite CS, AliasAnalysis &AA) {
       return;
     else if (AA.onlyReadsMemory(F)) {
       AliasTy = MayAlias;
-      AccessTy = Refs;
+      AccessTy |= Refs;
       return;
     }
   }
@@ -224,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());