summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-12-01 07:51:45 +0000
committerDuncan Sands <baldrick@free.fr>2007-12-01 07:51:45 +0000
commit68b6f50938c6b1c2211a4a81ed3a52a4f5b594e5 (patch)
tree6405192899bb2bb1cf3474b67a87747fa6d91edc /llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
parentae7a834e74e19f34b87c6546f5017ebb719bbad3 (diff)
downloadbcm5719-llvm-68b6f50938c6b1c2211a4a81ed3a52a4f5b594e5.tar.gz
bcm5719-llvm-68b6f50938c6b1c2211a4a81ed3a52a4f5b594e5.zip
Integrate the readonly/readnone logic more deeply
into alias analysis. This meant updating the API which now has versions of the getModRefBehavior, doesNotAccessMemory and onlyReadsMemory methods which take a callsite parameter. These should be used unless the callsite is not known, since in general they can do a better job than the versions that take a function. Also, users should no longer call the version of getModRefBehavior that takes both a function and a callsite. To reduce the chance of misuse it is now protected. llvm-svn: 44487
Diffstat (limited to 'llvm/lib/Analysis/MemoryDependenceAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index dd567aac95d..8c5f216f539 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -94,11 +94,9 @@ Instruction* MemoryDependenceAnalysis::getCallSiteDependency(CallSite C,
// FreeInsts erase the entire structure
pointerSize = ~0UL;
- } else if (CallSite::get(QI).getInstruction() != 0 &&
- cast<CallInst>(QI)->getCalledFunction()) {
+ } else if (isa<CallInst>(QI)) {
AliasAnalysis::ModRefBehavior result =
- AA.getModRefBehavior(cast<CallInst>(QI)->getCalledFunction(),
- CallSite::get(QI));
+ AA.getModRefBehavior(CallSite::get(QI));
if (result != AliasAnalysis::DoesNotAccessMemory &&
result != AliasAnalysis::OnlyReadsMemory) {
if (!start && !block) {
OpenPOWER on IntegriCloud