From 819f9d6bf91c439967ef623d0c047e7f672683fa Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 31 Jan 2013 02:45:26 +0000 Subject: [PATCH] Add a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174028 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/InstructionSimplify.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index 9f2aa59863f..18d90b62ce3 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());