[llvm] r174028 - Add a comment.
Dan Gohman
dan433584 at gmail.com
Wed Jan 30 18:45:26 PST 2013
Author: djg
Date: Wed Jan 30 20:45:26 2013
New Revision: 174028
URL: http://llvm.org/viewvc/llvm-project?rev=174028&view=rev
Log:
Add a comment.
Modified:
llvm/trunk/lib/Analysis/InstructionSimplify.cpp
Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=174028&r1=174027&r2=174028&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Wed Jan 30 20:45:26 2013
@@ -663,6 +663,10 @@ Value *llvm::SimplifyAddInst(Value *Op0,
/// 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());
More information about the llvm-commits
mailing list