From: Dan Gohman Date: Thu, 31 Jan 2013 02:45:26 +0000 (+0000) Subject: Add a comment. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36fa8398f5a6d8857f8a51c41337008f288cb333;p=platform%2Fupstream%2Fllvm.git Add a comment. llvm-svn: 174028 --- diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 9f2aa59..18d90b6 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/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());