diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-01-30 22:16:42 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-01-30 22:16:42 +0000 |
| commit | 9605576a21ecfad8044f8e4b4886fead9180cafd (patch) | |
| tree | 09d6ade267b5a1a9f0d54b20c261fe371fc1d86d /llvm | |
| parent | 6866e18e48f6ad9ab4a6a1946151a78b68200ec9 (diff) | |
| download | bcm5719-llvm-9605576a21ecfad8044f8e4b4886fead9180cafd.tar.gz bcm5719-llvm-9605576a21ecfad8044f8e4b4886fead9180cafd.zip | |
Improve mod/ref information based on the pointsToConstantMemory method.
llvm-svn: 11021
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Analysis/AliasAnalysis.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index c881ec283a9..373524b6c15 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -44,8 +44,15 @@ AliasAnalysis::getModRefInfo(LoadInst *L, Value *P, unsigned Size) { AliasAnalysis::ModRefResult AliasAnalysis::getModRefInfo(StoreInst *S, Value *P, unsigned Size) { - return alias(S->getOperand(1), TD->getTypeSize(S->getOperand(0)->getType()), - P, Size) ? Mod : NoModRef; + // If the stored address cannot alias the pointer in question, then the + // pointer cannot be modified by the store. + if (!alias(S->getOperand(1), TD->getTypeSize(S->getOperand(0)->getType()), + P, Size)) + return NoModRef; + + // If the pointer is a pointer to constant memory, then it could not have been + // modified by this store. + return pointsToConstantMemory(P) ? NoModRef : Mod; } |

