mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
If a function only reads memory, then we know that...
it only reads memory! The other change has no functional effect, it just seems more logical to go in order of decreasing knowledge. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64463 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
02b6a6a75f
commit
ddd8c450ec
@ -120,9 +120,13 @@ AliasAnalysis::getModRefBehavior(CallSite CS,
|
||||
AliasAnalysis::ModRefBehavior
|
||||
AliasAnalysis::getModRefBehavior(Function *F,
|
||||
std::vector<PointerAccessInfo> *Info) {
|
||||
if (F && F->doesNotAccessMemory())
|
||||
if (F) {
|
||||
if (F->doesNotAccessMemory())
|
||||
// Can't do better than this.
|
||||
return DoesNotAccessMemory;
|
||||
else if (F->onlyReadsMemory())
|
||||
return OnlyReadsMemory;
|
||||
}
|
||||
return UnknownModRefBehavior;
|
||||
}
|
||||
|
||||
@ -130,10 +134,10 @@ AliasAnalysis::ModRefResult
|
||||
AliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
|
||||
ModRefResult Mask = ModRef;
|
||||
ModRefBehavior MRB = getModRefBehavior(CS);
|
||||
if (MRB == OnlyReadsMemory)
|
||||
Mask = Ref;
|
||||
else if (MRB == DoesNotAccessMemory)
|
||||
if (MRB == DoesNotAccessMemory)
|
||||
return NoModRef;
|
||||
else if (MRB == OnlyReadsMemory)
|
||||
Mask = Ref;
|
||||
else if (MRB == AliasAnalysis::AccessesArguments) {
|
||||
bool doesAlias = false;
|
||||
for (CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
|
||||
|
Loading…
Reference in New Issue
Block a user