[PATCH] D20932: [LV] Use vector vphis for more induction variables

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 13:00:17 PDT 2016

mkuper added inline comments.

Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:4102
@@ -4100,2 +4101,3 @@
     assert(P->getType() == II.getStartValue()->getType() && "Types must match");
-    if (P != OldInduction || VF == 1) {
+    if (VF == 1 || P->getType() != Induction->getType() ||
+        !II.getConstIntStepValue()) {
delena wrote:
> If you need only SEXT or TRUNC for a secondary induction variable, you can send the type to widenInductionVariable() in the last parameter.
I'm intentionally getting this in in very small steps, so as not to regress the world in case the vector IVs aren't handled well by downstream passes.

In any case, passing the type to widenInductionVariable isn't the right thing here, since we don't need to truncate the start value. It should be enough to just remove the condition and let it fall into the widenInductionVariable case. That's going to be the next follow-up.


More information about the llvm-commits mailing list