summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/ValueTracking.h
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-08-18 18:43:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-08-18 18:43:08 +0000
commit4ae56d725d25020106d8056c09b19319a4c49e93 (patch)
treef63d5a12c0b0f3428777f954370af306d2bddb12 /include/llvm/Analysis/ValueTracking.h
parent3d7ff08c82be2f95902089dd59cff2a37999a991 (diff)
downloadllvm-4ae56d725d25020106d8056c09b19319a4c49e93.tar.gz
llvm-4ae56d725d25020106d8056c09b19319a4c49e93.tar.bz2
llvm-4ae56d725d25020106d8056c09b19319a4c49e93.tar.xz
Revert r111375, "move gep decomposition out of ValueTracking into BasicAA. The
form of", it doesn't pass tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ValueTracking.h')
-rw-r--r--include/llvm/Analysis/ValueTracking.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ValueTracking.h b/include/llvm/Analysis/ValueTracking.h
index 7b6026fea0..b9634f04ec 100644
--- a/include/llvm/Analysis/ValueTracking.h
+++ b/include/llvm/Analysis/ValueTracking.h
@@ -77,6 +77,25 @@ namespace llvm {
///
bool CannotBeNegativeZero(const Value *V, unsigned Depth = 0);
+ /// DecomposeGEPExpression - If V is a symbolic pointer expression, decompose
+ /// it into a base pointer with a constant offset and a number of scaled
+ /// symbolic offsets.
+ ///
+ /// The scaled symbolic offsets (represented by pairs of a Value* and a scale
+ /// in the VarIndices vector) are Value*'s that are known to be scaled by the
+ /// specified amount, but which may have other unrepresented high bits. As
+ /// such, the gep cannot necessarily be reconstructed from its decomposed
+ /// form.
+ ///
+ /// When TargetData is around, this function is capable of analyzing
+ /// everything that Value::getUnderlyingObject() can look through. When not,
+ /// it just looks through pointer casts.
+ ///
+ const Value *DecomposeGEPExpression(const Value *V, int64_t &BaseOffs,
+ SmallVectorImpl<std::pair<const Value*, int64_t> > &VarIndices,
+ const TargetData *TD);
+
+
/// FindInsertedValue - Given an aggregrate and an sequence of indices, see if
/// the scalar value indexed is already around as a register, for example if