diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-30 00:43:16 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-30 00:43:16 +0000 |
commit | 13815d9d3eec3d0ef2fc2f8a09e8ca8a9fa2654a (patch) | |
tree | b0215137792fcc4e92a136ba2c22577649c851ec /lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 647fea57fd56b7c0e24f98e01f2a70fd265cc461 (diff) |
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
Diffstat (limited to 'lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | lib/Analysis/BasicAliasAnalysis.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 3e63424090..74bee947a3 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -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; } |