aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2013-01-31 02:45:26 +0000
committerDan Gohman <dan433584@gmail.com>2013-01-31 02:45:26 +0000
commit819f9d6bf91c439967ef623d0c047e7f672683fa (patch)
tree8130dc29a595f365616d5acc1101a9fe25559f14 /lib/Analysis
parentde0eb19248f3053c07a5b1dad9c47b8435458337 (diff)
downloadexternal_llvm-819f9d6bf91c439967ef623d0c047e7f672683fa.zip
external_llvm-819f9d6bf91c439967ef623d0c047e7f672683fa.tar.gz
external_llvm-819f9d6bf91c439967ef623d0c047e7f672683fa.tar.bz2
Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index 9f2aa59..18d90b6 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -663,6 +663,10 @@ Value *llvm::SimplifyAddInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW,
/// 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());