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
This commit is contained in:
Chris Lattner 2005-03-23 23:27:34 +00:00
parent 8cfd24df54
commit 8eec644862

View File

@ -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;
}