mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-26 07:34:14 +00:00
Don't be COMPLETELY pessimistic in the face of function calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c87f0bb345
commit
5b5f7c11d0
@ -93,9 +93,21 @@ void AliasSet::addPointer(AliasSetTracker &AST, HashNodePair &Entry,
|
|||||||
RefCount++; // Entry points to alias set...
|
RefCount++; // Entry points to alias set...
|
||||||
}
|
}
|
||||||
|
|
||||||
void AliasSet::addCallSite(CallSite CS) {
|
void AliasSet::addCallSite(CallSite CS, AliasAnalysis &AA) {
|
||||||
CallSites.push_back(CS);
|
CallSites.push_back(CS);
|
||||||
AliasTy = MayAlias; // FIXME: Too conservative?
|
|
||||||
|
if (Function *F = CS.getCalledFunction()) {
|
||||||
|
if (AA.doesNotAccessMemory(F))
|
||||||
|
return;
|
||||||
|
else if (AA.onlyReadsMemory(F)) {
|
||||||
|
AliasTy = MayAlias;
|
||||||
|
AccessTy = Refs;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FIXME: This should use mod/ref information to make this not suck so bad
|
||||||
|
AliasTy = MayAlias;
|
||||||
AccessTy = ModRef;
|
AccessTy = ModRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +141,11 @@ bool AliasSet::aliasesPointer(const Value *Ptr, unsigned Size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool AliasSet::aliasesCallSite(CallSite CS, AliasAnalysis &AA) const {
|
bool AliasSet::aliasesCallSite(CallSite CS, AliasAnalysis &AA) const {
|
||||||
// FIXME: Too conservative!
|
// FIXME: Use mod/ref information to prune this better!
|
||||||
|
if (Function *F = CS.getCalledFunction())
|
||||||
|
if (AA.doesNotAccessMemory(F))
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +229,7 @@ void AliasSetTracker::add(CallSite CS) {
|
|||||||
AliasSets.push_back(AliasSet());
|
AliasSets.push_back(AliasSet());
|
||||||
AS = &AliasSets.back();
|
AS = &AliasSets.back();
|
||||||
}
|
}
|
||||||
AS->addCallSite(CS);
|
AS->addCallSite(CS, AA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AliasSetTracker::add(Instruction *I) {
|
void AliasSetTracker::add(Instruction *I) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user