[PATCH] D12765: [LV] Allow vectorization of loops with induction post-inc expressions
Michael Zolotukhin via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 09:51:05 PDT 2015
mzolotukhin added a comment.
Hi Jakub,
The problem with the current approach is that it only fixes one case, that is caused by a different problem (as you showed - the actual problem is in IndVarSimplify/SCEVExpander). We fix consequences, not the rootcause itself. Maybe next week someone will come up with a patch, that would fix the same issue in LoopUnroller, and next week - in LoopInterchange or any other loop transformation.
It might be not-trivial to fix it in SCEV/IndVarSimplify, but I think it should be possible, and that's what we need to try first. For this case we just need to teach SCEV/IndVarSimplify to take into account loop invariants. E.g. the entire expression `(zext i32 (-3 + (-1 * (-4097 smax (-1 + (-1 * %y))))<nsw>) to i64)` is a loop invariant, so it shouldn't have high cost.
The fix in vectorizer might be simple, but I believe it's a (small) step in a wrong direction.
Michael
Repository:
rL LLVM
http://reviews.llvm.org/D12765
More information about the llvm-commits
mailing list