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 | 35814e61287ba7539a731fab019b8ac299accba4 (patch) | |
tree | 24f8d8d10de7a9f42a9d5814a98563de12de79d6 /llvm/lib/Transforms/IPO/FunctionAttrs.cpp | |
parent | 88ff1ece63c9936946b89d1237f00aeca2e6530f (diff) | |
download | bcm5719-llvm-35814e61287ba7539a731fab019b8ac299accba4.tar.gz bcm5719-llvm-35814e61287ba7539a731fab019b8ac299accba4.zip |
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.
llvm-svn: 118624
Diffstat (limited to 'llvm/lib/Transforms/IPO/FunctionAttrs.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/FunctionAttrs.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp b/llvm/lib/Transforms/IPO/FunctionAttrs.cpp index 71671d6fe9a..fcdc5f18f16 100644 --- a/llvm/lib/Transforms/IPO/FunctionAttrs.cpp +++ b/llvm/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; |