git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174028
91177308-0d34-0410-b5e6-
96231b3b80d8
/// accumulates the total constant offset applied in the returned constant. It
/// returns 0 if V is not a pointer, and returns the constant '0' if there are
/// no constant offsets applied.
+///
+/// This is very similar to GetPointerBaseWithConstantOffset except it doesn't
+/// follow non-inbounds geps. This allows it to remain usable for icmp ult/etc.
+/// folding.
static Constant *stripAndComputeConstantOffsets(const DataLayout &TD,
Value *&V) {
assert(V->getType()->isPointerTy());