summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-23 23:27:34 +0000
committerChris Lattner <sabre@nondot.org>2005-03-23 23:27:34 +0000
commit8eec644862251e14add0d2707d655fcce91e8f70 (patch)
treee7487028bc11f3665593c1c422ae0ddcbb642615 /include
parent8cfd24df54025fcc56ce3707f1223958b9204813 (diff)
downloadllvm-8eec644862251e14add0d2707d655fcce91e8f70.tar.gz
llvm-8eec644862251e14add0d2707d655fcce91e8f70.tar.bz2
llvm-8eec644862251e14add0d2707d655fcce91e8f70.tar.xz
if a function doesn't access memory at all, it definitely doesn't read it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/AliasAnalysis.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h
index 73b646d935..0857190c5c 100644
--- a/include/llvm/Analysis/AliasAnalysis.h
+++ b/include/llvm/Analysis/AliasAnalysis.h
@@ -214,7 +214,8 @@ public:
bool onlyReadsMemory(Function *F) {
/// FIXME: If the analysis returns more precise info, we can reduce it to
/// this.
- return getModRefBehavior(F, CallSite()) == OnlyReadsMemory;
+ ModRefBehavior MRB = getModRefBehavior(F, CallSite());
+ return MRB == DoesNotAccessMemory || MRB == OnlyReadsMemory;
}