mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-13 08:25:27 +00:00
enhance basicaa to return "Mod" for a memcpy call when the
queried location doesn't overlap the source, and add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120370 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -687,10 +687,15 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS,
|
||||
Len = LenCI->getZExtValue();
|
||||
Value *Dest = II->getArgOperand(0);
|
||||
Value *Src = II->getArgOperand(1);
|
||||
// If it can't overlap the source dest, then it doesn't modref the loc.
|
||||
if (isNoAlias(Location(Dest, Len), Loc)) {
|
||||
if (isNoAlias(Location(Src, Len), Loc))
|
||||
return NoModRef;
|
||||
// If it can't overlap the dest, then worst case it reads the loc.
|
||||
Min = Ref;
|
||||
} else if (isNoAlias(Location(Src, Len), Loc)) {
|
||||
// If it can't overlap the source, then worst case it mutates the loc.
|
||||
Min = Mod;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user