diff options
| author | Duncan Sands <baldrick@free.fr> | 2010-01-06 08:45:52 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2010-01-06 08:45:52 +0000 |
| commit | 78376ad7e15740eab9bed7efefca354c05d3d2e2 (patch) | |
| tree | 882bcbdbddcdd85694fc7ffcae1010d4f1195068 /llvm/lib/Analysis/AliasAnalysis.cpp | |
| parent | a671c2a9fe496d8694ad7f6daa84f5b5d7f193a4 (diff) | |
| download | llvm-78376ad7e15740eab9bed7efefca354c05d3d2e2.zip llvm-78376ad7e15740eab9bed7efefca354c05d3d2e2.tar.gz llvm-78376ad7e15740eab9bed7efefca354c05d3d2e2.tar.bz2 | |
Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.
llvm-svn: 92829
Diffstat (limited to 'llvm/lib/Analysis/AliasAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index dee9b53..371dcaf 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -116,13 +116,16 @@ AliasAnalysis::getModRefBehavior(Function *F, return DoesNotAccessMemory; if (F->onlyReadsMemory()) return OnlyReadsMemory; - if (unsigned id = F->getIntrinsicID()) { + if (unsigned id = F->getIntrinsicID()) + return getModRefBehavior(id); + } + return UnknownModRefBehavior; +} + +AliasAnalysis::ModRefBehavior AliasAnalysis::getModRefBehavior(unsigned iid) { #define GET_INTRINSIC_MODREF_BEHAVIOR #include "llvm/Intrinsics.gen" #undef GET_INTRINSIC_MODREF_BEHAVIOR - } - } - return UnknownModRefBehavior; } AliasAnalysis::ModRefResult |
