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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 09:58:14 PDT 2020


fhahn accepted this revision.
fhahn added a comment.
This revision is now accepted and ready to land.

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.



================
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
----------------
Better to use a non-undef constant/value?


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