diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-15 18:14:04 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-15 18:14:04 +0000 |
commit | aefd5fa18a3e0340b818ae83605cbf1d0af025ce (patch) | |
tree | 9ac33b780ab643683149822f92b9be1748270210 /llvm/lib | |
parent | c0bd4b19b8e3bba578ca2ef84b53aad7e558bd71 (diff) | |
download | bcm5719-llvm-aefd5fa18a3e0340b818ae83605cbf1d0af025ce.tar.gz bcm5719-llvm-aefd5fa18a3e0340b818ae83605cbf1d0af025ce.zip |
Eliminate a virtual method call
llvm-svn: 18964
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/LoadValueNumbering.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/LoadValueNumbering.cpp b/llvm/lib/Analysis/LoadValueNumbering.cpp index a8c9d5f231c..67d675f40bc 100644 --- a/llvm/lib/Analysis/LoadValueNumbering.cpp +++ b/llvm/lib/Analysis/LoadValueNumbering.cpp @@ -144,7 +144,10 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI, Function *CF = CI->getCalledFunction(); if (CF == 0) return; // Indirect call. AliasAnalysis &AA = getAnalysis<AliasAnalysis>(); - if (!AA.onlyReadsMemory(CF)) return; // Nothing we can do. + AliasAnalysis::ModRefBehavior MRB = AA.getModRefBehavior(CF, CI); + if (MRB != AliasAnalysis::DoesNotAccessMemory && + MRB != AliasAnalysis::OnlyReadsMemory) + return; // Nothing we can do for now. // Scan all of the arguments of the function, looking for one that is not // global. In particular, we would prefer to have an argument or instruction @@ -193,7 +196,7 @@ void LoadVN::getCallEqualNumberNodes(CallInst *CI, // whether an intervening instruction could modify memory that is read, not // ANY memory. // - if (!AA.doesNotAccessMemory(CF)) { + if (MRB == AliasAnalysis::OnlyReadsMemory) { DominatorSet &DomSetInfo = getAnalysis<DominatorSet>(); BasicBlock *CIBB = CI->getParent(); for (unsigned i = 0; i != IdenticalCalls.size(); ++i) { |