aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/LoadValueNumbering.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
commitdff6710717b159f089c76a07eda074eb6347eb92 (patch)
tree7bbd754ebe64f5d4bbc6000e0e66bdd99f9c847f /lib/Analysis/LoadValueNumbering.cpp
parente3110d0825e6316fd2dd21d6a4e593295cd413f1 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44487 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoadValueNumbering.cpp')
-rw-r--r--lib/Analysis/LoadValueNumbering.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index 3af92bc11c..67d4dd22bb 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -148,7 +148,7 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
Function *CF = CI->getCalledFunction();
if (CF == 0) return; // Indirect call.
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
- AliasAnalysis::ModRefBehavior MRB = AA.getModRefBehavior(CF, CI);
+ AliasAnalysis::ModRefBehavior MRB = AA.getModRefBehavior(CI);
if (MRB != AliasAnalysis::DoesNotAccessMemory &&
MRB != AliasAnalysis::OnlyReadsMemory)
return; // Nothing we can do for now.
@@ -227,8 +227,7 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI,
CantEqual = true;
break;
} else if (CallInst *CI = dyn_cast<CallInst>(I)) {
- if (CI->getCalledFunction() == 0 ||
- !AA.onlyReadsMemory(CI->getCalledFunction())) {
+ if (!AA.onlyReadsMemory(CI)) {
CantEqual = true;
break;
}