mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +00:00
Add argmemonly attribute.
This change adds new attribute called "argmemonly". Function marked with this attribute can only access memory through it's argument pointers. This attribute directly corresponds to the "OnlyAccessesArgumentPointees" ModRef behaviour in alias analysis. Differential Revision: http://reviews.llvm.org/D10398 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241979 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -685,6 +685,9 @@ BasicAliasAnalysis::getModRefBehavior(ImmutableCallSite CS) {
|
||||
if (CS.onlyReadsMemory())
|
||||
Min = OnlyReadsMemory;
|
||||
|
||||
if (CS.onlyAccessesArgMemory())
|
||||
Min = ModRefBehavior(Min & OnlyAccessesArgumentPointees);
|
||||
|
||||
// The AliasAnalysis base class has some smarts, lets use them.
|
||||
return ModRefBehavior(AliasAnalysis::getModRefBehavior(CS) & Min);
|
||||
}
|
||||
@@ -710,6 +713,9 @@ BasicAliasAnalysis::getModRefBehavior(const Function *F) {
|
||||
if (F->onlyReadsMemory())
|
||||
Min = OnlyReadsMemory;
|
||||
|
||||
if (F->onlyAccessesArgMemory())
|
||||
Min = ModRefBehavior(Min & OnlyAccessesArgumentPointees);
|
||||
|
||||
const TargetLibraryInfo &TLI =
|
||||
getAnalysis<TargetLibraryInfoWrapperPass>().getTLI();
|
||||
if (isMemsetPattern16(F, TLI))
|
||||
|
Reference in New Issue
Block a user