summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-01-30 22:15:41 +0000
committerChris Lattner <sabre@nondot.org>2004-01-30 22:15:41 +0000
commit762e8e846f0ad50ffea56216c5ea20db1c95b756 (patch)
treea01d89abaf096bc80c30f2a6063c620af2a046ae /include
parentcf93cdde567c2fd4a5e5539a736836cdfe935c66 (diff)
downloadllvm-762e8e846f0ad50ffea56216c5ea20db1c95b756.tar.gz
llvm-762e8e846f0ad50ffea56216c5ea20db1c95b756.tar.bz2
llvm-762e8e846f0ad50ffea56216c5ea20db1c95b756.tar.xz
Add a new pointsToConstantMemory method to the AliasAnalysis interface
which can be implemented to improve the quality of mod-ref information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Analysis/AliasAnalysis.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h
index b0e9b23ab1..9b5d8ff037 100644
--- a/include/llvm/Analysis/AliasAnalysis.h
+++ b/include/llvm/Analysis/AliasAnalysis.h
@@ -95,6 +95,11 @@ public:
///
virtual void getMustAliases(Value *P, std::vector<Value*> &RetVals) {}
+ /// pointsToConstantMemory - If the specified pointer is known to point into
+ /// constant global memory, return true. This allows disambiguation of store
+ /// instructions from constant pointers.
+ ///
+ virtual bool pointsToConstantMemory(const Value *P) { return false; }
//===--------------------------------------------------------------------===//
/// Simple mod/ref information...
@@ -114,7 +119,9 @@ public:
/// pointer.
///
virtual ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size) {
- return ModRef;
+ // If P points to a constant memory location, the call definitely could not
+ // modify the memory location.
+ return pointsToConstantMemory(P) ? Ref : ModRef;
}
/// getModRefInfo - Return information about whether two call sites may refer