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 | 90c4947df73cf2251b6ad2c1722547ccc812c66e (patch) | |
tree | 0f7d676b48e41aa3fa5425947769211bc87db750 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 62718de2b95e875505ec2b46b0ee0c0665d45ddf (diff) | |
download | bcm5719-llvm-90c4947df73cf2251b6ad2c1722547ccc812c66e.tar.gz bcm5719-llvm-90c4947df73cf2251b6ad2c1722547ccc812c66e.zip |
enhance basicaa to return "Mod" for a memcpy call when the
queried location doesn't overlap the source, and add a testcase.
llvm-svn: 120370
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 3e634240901..74bee947a3d 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/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; } |