summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/ValueTracking.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-11-30 23:05:20 +0000
committerChris Lattner <sabre@nondot.org>2010-11-30 23:05:20 +0000
commita04096580a65b6cfbe12dabf6d695f7303750c0d (patch)
tree0dd3f641c599ed0675c9579f72c70fa4c010f872 /include/llvm/Analysis/ValueTracking.h
parent1fd374e9c1c074c1681336bef31e65f0170b0f7e (diff)
downloadllvm-a04096580a65b6cfbe12dabf6d695f7303750c0d.tar.gz
llvm-a04096580a65b6cfbe12dabf6d695f7303750c0d.tar.bz2
llvm-a04096580a65b6cfbe12dabf6d695f7303750c0d.tar.xz
teach DSE to use GetPointerBaseWithConstantOffset to analyze
may-aliasing stores that partially overlap with different base pointers. This implements PR6043 and the non-variable part of PR8657 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ValueTracking.h')
-rw-r--r--include/llvm/Analysis/ValueTracking.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index b95749f5ed..953d9106ed 100644
--- a/include/llvm/Analysis/ValueTracking.h
+++ b/include/llvm/Analysis/ValueTracking.h
@@ -102,6 +102,11 @@ namespace llvm {
/// base and offset to the caller.
Value *GetPointerBaseWithConstantOffset(Value *Ptr, int64_t &Offset,
const TargetData &TD);
+ static inline const Value *
+ GetPointerBaseWithConstantOffset(const Value *Ptr, int64_t &Offset,
+ const TargetData &TD) {
+ return GetPointerBaseWithConstantOffset(const_cast<Value*>(Ptr), Offset,TD);
+ }
/// GetConstantStringInfo - This function computes the length of a
/// null-terminated C string pointed to by V. If successful, it returns true