mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Teach BasicAA::getModRefInfo(CallSite, CallSite) some
tricks based on readnone/readonly functions. Teach memdep to look past readonly calls when analyzing deps for a readonly call. This allows elimination of a few more calls from 403.gcc: before: 63 gvn - Number of instructions PRE'd 153986 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted after: 63 gvn - Number of instructions PRE'd 153991 gvn - Number of instructions deleted 50069 gvn - Number of loads deleted 5 calls isn't much, but this adds plumbing for the next change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60794 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -264,10 +264,8 @@ namespace {
|
||||
const Value *V2, unsigned V2Size);
|
||||
|
||||
ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
|
||||
ModRefResult getModRefInfo(CallSite CS1, CallSite CS2) {
|
||||
return NoAA::getModRefInfo(CS1,CS2);
|
||||
}
|
||||
|
||||
ModRefResult getModRefInfo(CallSite CS1, CallSite CS2);
|
||||
|
||||
/// hasNoModRefInfoForCalls - We can provide mod/ref information against
|
||||
/// non-escaping allocations.
|
||||
virtual bool hasNoModRefInfoForCalls() const { return false; }
|
||||
@@ -352,6 +350,24 @@ BasicAliasAnalysis::getModRefInfo(CallSite CS, Value *P, unsigned Size) {
|
||||
}
|
||||
|
||||
|
||||
AliasAnalysis::ModRefResult
|
||||
BasicAliasAnalysis::getModRefInfo(CallSite CS1, CallSite CS2) {
|
||||
// If CS1 or CS2 are readnone, they don't interact.
|
||||
ModRefBehavior CS1B = AliasAnalysis::getModRefBehavior(CS1);
|
||||
if (CS1B == DoesNotAccessMemory) return NoModRef;
|
||||
|
||||
ModRefBehavior CS2B = AliasAnalysis::getModRefBehavior(CS2);
|
||||
if (CS2B == DoesNotAccessMemory) return NoModRef;
|
||||
|
||||
// If they both only read from memory, just return ref.
|
||||
if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory)
|
||||
return Ref;
|
||||
|
||||
// Otherwise, fall back to NoAA (mod+ref).
|
||||
return NoAA::getModRefInfo(CS1, CS2);
|
||||
}
|
||||
|
||||
|
||||
// alias - Provide a bunch of ad-hoc rules to disambiguate in common cases, such
|
||||
// as array references. Note that this function is heavily tail recursive.
|
||||
// Hopefully we have a smart C++ compiler. :)
|
||||
|
Reference in New Issue
Block a user