mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-07 04:38:20 +00:00
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
This commit is contained in:
parent
ebeb34d412
commit
4651780f86
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user