[llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sun Mar 14 22:09:23 PST 2004
Changes in directory llvm/lib/Analysis:
AliasSetTracker.cpp updated: 1.10 -> 1.11
---
Log message:
Don't be COMPLETELY pessimistic in the face of function calls
---
Diffs of the changes: (+20 -4)
Index: llvm/lib/Analysis/AliasSetTracker.cpp
diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.10 llvm/lib/Analysis/AliasSetTracker.cpp:1.11
--- llvm/lib/Analysis/AliasSetTracker.cpp:1.10 Thu Dec 18 02:11:56 2003
+++ llvm/lib/Analysis/AliasSetTracker.cpp Sun Mar 14 22:08:36 2004
@@ -93,9 +93,21 @@
RefCount++; // Entry points to alias set...
}
-void AliasSet::addCallSite(CallSite CS) {
+void AliasSet::addCallSite(CallSite CS, AliasAnalysis &AA) {
CallSites.push_back(CS);
- AliasTy = MayAlias; // FIXME: Too conservative?
+
+ if (Function *F = CS.getCalledFunction()) {
+ if (AA.doesNotAccessMemory(F))
+ return;
+ else if (AA.onlyReadsMemory(F)) {
+ AliasTy = MayAlias;
+ AccessTy = Refs;
+ return;
+ }
+ }
+
+ // FIXME: This should use mod/ref information to make this not suck so bad
+ AliasTy = MayAlias;
AccessTy = ModRef;
}
@@ -129,7 +141,11 @@
}
bool AliasSet::aliasesCallSite(CallSite CS, AliasAnalysis &AA) const {
- // FIXME: Too conservative!
+ // FIXME: Use mod/ref information to prune this better!
+ if (Function *F = CS.getCalledFunction())
+ if (AA.doesNotAccessMemory(F))
+ return false;
+
return true;
}
@@ -213,7 +229,7 @@
AliasSets.push_back(AliasSet());
AS = &AliasSets.back();
}
- AS->addCallSite(CS);
+ AS->addCallSite(CS, AA);
}
void AliasSetTracker::add(Instruction *I) {
More information about the llvm-commits
mailing list