The two-callsite form of AliasAnalysis::getModRefInfo is documented

to return Ref if the left callsite only reads memory read or written
by the right callsite; fix BasicAliasAnalysis to implement this.

Add AliasAnalysisEvaluator support for testing the two-callsite
form of getModRefInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-08-04 22:56:29 +00:00
parent abf7bdffd6
commit 3dcc91ee8c
4 changed files with 50 additions and 6 deletions

View File

@ -425,8 +425,8 @@ BasicAliasAnalysis::getModRefInfo(ImmutableCallSite CS1,
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)
// If CS1 only reads from memory, just return ref.
if (CS1B == OnlyReadsMemory)
return Ref;
// Otherwise, fall back to NoAA (mod+ref).