[PATCH] D10835: getStrideFromPointer and its helper function from LoopVectorize moved to VectorUtils

hfinkel at anl.gov hfinkel at anl.gov
Thu Jul 2 16:02:30 PDT 2015


hfinkel added a subscriber: hfinkel.

================
Comment at: include/llvm/Analysis/VectorUtils.h:65
@@ +64,3 @@
+
+/// \brief Remove GEPs whose indices but the last one are loop invariant and
+/// return the induction operand of the gep pointer.
----------------
I don't understand this comment.

Looking at the implementation, this function returns its first argument. If the argument is a GEP, then it normally returns the operand identified by getGEPInductionOperand. However, if there is some other non-loop-invariant operand, it returns that instead.


================
Comment at: include/llvm/Analysis/VectorUtils.h:69
@@ +68,3 @@
+
+/// \brief Look for a cast use of the passed value.
+Value *getUniqueCastUse(Value *Ptr, Loop *Lp, Type *Ty);
----------------
a case use -> a unique case use, or better, just say:

  If a value has only one user that is a CastInst, return it.


================
Comment at: include/llvm/Analysis/VectorUtils.h:74
@@ +73,3 @@
+/// Looks for symbolic strides "a[i*stride]". Returns the symbolic stride as a
+/// pointer to the Value, or null otherwise.
+Value *getStrideFromPointer(Value *Ptr, ScalarEvolution *SE, Loop *Lp);
----------------
Don't need to say 'a pointer to', Values are always passed by pointer.



rL LLVM

http://reviews.llvm.org/D10835







More information about the llvm-commits mailing list