diff options
author | Dan Gohman <gohman@apple.com> | 2010-11-09 20:13:27 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-11-09 20:13:27 +0000 |
commit | 6d44d64f61359c865cbf2d7f331bb9c97ce253d5 (patch) | |
tree | abea59789976571549679818780a3b8ed66f568d /lib/Transforms | |
parent | 1cdaa3e5b1128bd9e62ad9b5084db8a44b897e88 (diff) | |
download | external_llvm-6d44d64f61359c865cbf2d7f331bb9c97ce253d5.zip external_llvm-6d44d64f61359c865cbf2d7f331bb9c97ce253d5.tar.gz external_llvm-6d44d64f61359c865cbf2d7f331bb9c97ce253d5.tar.bz2 |
Use the AliasAnalysis interface to determine how a Function accesses
memory. This isn't a real improvement with present day AliasAnalysis
implementations; it's mainly for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/IPO/FunctionAttrs.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/IPO/FunctionAttrs.cpp b/lib/Transforms/IPO/FunctionAttrs.cpp index 71671d6..fcdc5f1 100644 --- a/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/lib/Transforms/IPO/FunctionAttrs.cpp @@ -101,14 +101,15 @@ bool FunctionAttrs::AddReadAttrs(const CallGraphSCC &SCC) { // External node - may write memory. Just give up. return false; - if (F->doesNotAccessMemory()) + AliasAnalysis::ModRefBehavior MRB = AA->getModRefBehavior(F); + if (MRB == AliasAnalysis::DoesNotAccessMemory) // Already perfect! continue; // Definitions with weak linkage may be overridden at linktime with // something that writes memory, so treat them like declarations. if (F->isDeclaration() || F->mayBeOverridden()) { - if (!F->onlyReadsMemory()) + if (!AliasAnalysis::onlyReadsMemory(MRB)) // May write memory. Just give up. return false; |