[llvm-commits] CVS: llvm/lib/Analysis/AliasSetTracker.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jul 26 19:20:36 PDT 2004
Changes in directory llvm/lib/Analysis:
AliasSetTracker.cpp updated: 1.23 -> 1.24
---
Log message:
Use context-sensitive alias analysis to avoid pessimization in clients of
AliasSetTracker (dse and licm). This implements
DeadStoreElimination/context-sensitive.llx
---
Diffs of the changes: (+23 -5)
Index: llvm/lib/Analysis/AliasSetTracker.cpp
diff -u llvm/lib/Analysis/AliasSetTracker.cpp:1.23 llvm/lib/Analysis/AliasSetTracker.cpp:1.24
--- llvm/lib/Analysis/AliasSetTracker.cpp:1.23 Mon Jul 26 00:50:23 2004
+++ llvm/lib/Analysis/AliasSetTracker.cpp Mon Jul 26 21:20:26 2004
@@ -138,20 +138,38 @@
return true;
// Check the call sites list and invoke list...
- if (!CallSites.empty())
- // FIXME: this is pessimistic!
- return true;
+ if (!CallSites.empty()) {
+ if (AA.hasNoModRefInfoForCalls())
+ return true;
+
+ for (unsigned i = 0, e = CallSites.size(); i != e; ++i)
+ if (AA.getModRefInfo(CallSites[i], const_cast<Value*>(Ptr), Size)
+ != AliasAnalysis::NoModRef)
+ return true;
+ }
return false;
}
bool AliasSet::aliasesCallSite(CallSite CS, AliasAnalysis &AA) const {
- // FIXME: Use mod/ref information to prune this better!
if (Function *F = CS.getCalledFunction())
if (AA.doesNotAccessMemory(F))
return false;
- return true;
+ if (AA.hasNoModRefInfoForCalls())
+ return true;
+
+ for (unsigned i = 0, e = CallSites.size(); i != e; ++i)
+ if (AA.getModRefInfo(CallSites[i], CS) != AliasAnalysis::NoModRef ||
+ AA.getModRefInfo(CS, CallSites[i]) != AliasAnalysis::NoModRef)
+ return true;
+
+ for (iterator I = begin(), E = end(); I != E; ++I)
+ if (AA.getModRefInfo(CS, I.getPointer(), I.getSize()) !=
+ AliasAnalysis::NoModRef)
+ return true;
+
+ return false;
}
More information about the llvm-commits
mailing list