[PATCH] D21330: Loop vectorization with FP induction variables

Elena Demikhovsky via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 20 10:12:37 PDT 2016


delena added inline comments.

================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:1610
@@ -1609,3 +1609,3 @@
   Value *V = expand(SH);
-  if (Ty) {
+  if (Ty && SE.isSCEVable(Ty)) {
     assert(SE.getTypeSizeInBits(Ty) == SE.getTypeSizeInBits(SH->getType()) &&
----------------
sanjoy wrote:
> Why do we need this?
I defined Step as unknown SCEV, but underlying value is of floating point type.
In this case expand() just returns the underlying value, but it fails on one of these two lines.

================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:758
@@ +757,3 @@
+
+  const Loop *L = SE->getLoopFor(Phi->getParent());
+  if (!L || L->getHeader() != Phi->getParent())
----------------
sanjoy wrote:
> Looking at the users of `isInductionPHI`, looks like it should be easy to pass in the `Loop *` directly?  If so, can we just have this check be: `if (L->getHeader() != Phi->getParent()) return false;` ?  That way we won't have to add the `getLoopFor` interface to SCEV (which does not look like it belongs there).
> 
Yes, of course. I'll change.


Repository:
  rL LLVM

http://reviews.llvm.org/D21330





More information about the llvm-commits mailing list