aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/AliasAnalysis.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-10 17:34:04 +0000
committerDan Gohman <gohman@apple.com>2010-11-10 17:34:04 +0000
commit432d08cbdb9ceaa333f1d6eab4f8b542fdddf9db (patch)
treee1aa716938b0d913cdca6e28aa412bd7fd2f11ad /include/llvm/Analysis/AliasAnalysis.h
parent50bcaece670fea4c936c6730fab9f4d869d2ec67 (diff)
downloadexternal_llvm-432d08cbdb9ceaa333f1d6eab4f8b542fdddf9db.zip
external_llvm-432d08cbdb9ceaa333f1d6eab4f8b542fdddf9db.tar.gz
external_llvm-432d08cbdb9ceaa333f1d6eab4f8b542fdddf9db.tar.bz2
Factor out the code for testing whether a function accesses
arbitrary memory into a helper function, and adjust some comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/AliasAnalysis.h')
-rw-r--r--include/llvm/Analysis/AliasAnalysis.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h
index 6b716dd..12b2090 100644
--- a/include/llvm/Analysis/AliasAnalysis.h
+++ b/include/llvm/Analysis/AliasAnalysis.h
@@ -268,14 +268,21 @@ public:
return onlyReadsMemory(getModRefBehavior(F));
}
- /// onlyReadsMemory - If the functions with the specified behavior are known
- /// to only read from non-volatile memory (or not access memory at all), return
- /// true. For use when the call site is not known.
+ /// onlyReadsMemory - Return true if functions with the specified behavior are
+ /// known to only read from non-volatile memory (or not access memory at all).
///
static bool onlyReadsMemory(ModRefBehavior MRB) {
return !(MRB & Mod);
}
+ /// onlyAccessesArgPointees - Return true if functions with the specified
+ /// behavior are known to read at most from objects pointed to by their
+ /// pointer-typed arguments (with arbitrary offsets).
+ ///
+ static bool onlyAccessesArgPointees(ModRefBehavior MRB) {
+ return !(MRB & Anywhere & ~ArgumentPointees);
+ }
+
/// getModRefInfo - Return information about whether or not an instruction may
/// read or write the specified memory location. An instruction
/// that doesn't read or write memory may be trivially LICM'd for example.