[PATCH] D83470: [LV] Fix versioning-for-unit-stide of loops with small trip count

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 12 10:48:32 PDT 2020


Ayal marked an inline comment as done.
Ayal added a comment.

In D83470#2142057 <https://reviews.llvm.org/D83470#2142057>, @fhahn wrote:

> LGTM, thanks!
>
> > In such cases, the loop vectorizer should either re-run the analysis or bail-out from vectorizing the loop, as done prior to D81345 <https://reviews.llvm.org/D81345>. The latter is chosen for now as the former requires refactoring.
>
> As already discussed in D81345 <https://reviews.llvm.org/D81345>, ideally LV would have more flexibility to drive LAA, but this requires non-trivial refactoring. Which we should do, but until then the patch looks like a reasonable fix to the crash.


Indeed, seems like LV would need to re-run analyzeLoop(), which would affect other users.



================
Comment at: llvm/test/Transforms/LoopVectorize/optsize.ll:239
+  %l1.02 = phi i16 [ 1, %entry ], [ %inc9, %for.body ]
+  %mul = mul nsw i16 %l1.02, undef
+  %arrayidx6 = getelementptr inbounds [1 x i16], [1 x i16]* @g, i16 0, i16 %mul
----------------
fhahn wrote:
> Better to use a non-undef constant/value?
Sure, done, thanks.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83470/new/

https://reviews.llvm.org/D83470





More information about the llvm-commits mailing list