mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1cdaa3e5b1
commit
6d44d64f61
@ -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