[PATCH] D101916: [LoopVectorize] Fix crash for predicated instructions with scalable VF

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 09:42:27 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5594-5595
     for (Instruction &I : *BB) {
+      // Check the loop body. All instructions are in the loop body and not in
+      // the tail when the scalar epilogue is not allowed.
+      if (!Legal->canVectorizeWithPredication(&I, !isScalarEpilogueAllowed())) {
----------------
nit: Hi @CarolineConcatto, this is just a suggestion but I think it might be clearer here to say something like:

  // Check we are able to vectorize predicated instructions using scalable
  // vectors. Such predication may occur if the scalar epilogue is folded into
  // the vector loop body.

Not sure what others think?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5598
+        Msg = "Scalable vectorization not supported for predicated operations "
+              "found in this loop. Using fixed-width vectorization instead.";
+        return false;
----------------
I wonder if this is potentially misleading as we're not guaranteed to fall back on fixed-width vectorization, particularly if the user applied a C/C++ pragma to the loop?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101916



More information about the llvm-commits mailing list