[PATCH] D21620: [LV] Don't widen trivial induction variables

Adam Nemet via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 09:51:09 PDT 2016


anemet added inline comments.

================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:2191
@@ +2190,3 @@
+
+  // We can't create a vector with less than two elements.
+  assert(VF > 1 && "VF should be greater than one");
----------------
Matt, your argument about instcombine not being adequate for this is a convincing one.

On the other hand, I am still wondering if the solution is general enough.  There should be cases where we'd be better off having *both* the vector and the scalar version of the same induction variable.  I.e. depending on the use, you may want to use the vector version (e.g. store) or the scalar version (address calc, compares).

I am not saying that we need to necessarily implement this but the current solution should be taking us incrementally closer to the full solution.


http://reviews.llvm.org/D21620





More information about the llvm-commits mailing list