Fix memdep's code for reasoning about dependences between two calls. A Ref

response from getModRefInfo is not useful here. Instead, check for identical
calls only in the NoModRef case.

Reapply r110270, and strengthen it to compensate for the memdep changes.
When both calls are readonly, there is no dependence between them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110382 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2010-08-05 22:09:15 +00:00
parent 3ecf355c7a
commit 5fa417c790
3 changed files with 14 additions and 21 deletions
+6 -1
View File
@@ -425,8 +425,13 @@ 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 they both only read from memory, there is no dependence.
if (CS1B == OnlyReadsMemory && CS2B == OnlyReadsMemory)
return NoModRef;
// If CS1 only reads memory, the only dependence on CS2 can be
// from CS1 reading memory written by CS2.
if (CS1B == OnlyReadsMemory)
return Ref;
// Otherwise, fall back to NoAA (mod+ref).