[PATCH] D109432: [LoopVectorize] Permit fixed-width epilogue loops for scalable vector bodies

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 10 14:33:23 PDT 2021


bmahjour added a comment.

Different plans may have different recipes, so if we don't find a single plan that supports both the main VF and the epilogue VF, I worry we may get unintended codegen. Furthermore, what guarantees that a vplan with a fixed-width conversion from the scalable VF actually exists? Would it be possible to build scalable plans that include the corresponding fixed width (and some lower powers of 2) VFs?



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6262
 
-  if (!isEpilogueVectorizationProfitable(MainLoopVF))
+  ElementCount EpilogueVF = MainLoopVF;
+  if (EpilogueVF.isScalable()) {
----------------
"EpilogueVF" is confusing here, since the rest of the logic expects main-loop VF. Suggest renaming to "KnownMainLoopVF" or "FixedMainLoopVF" or "FixedWidthMainLoopVF".


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:6266
+        dbgs() << "LEV: Epilogue vectorization using scalable vectors not "
+                  "yet supported. Converting to fixed-width instead\n");
+    EpilogueVF = ElementCount::getFixed(EpilogueVF.getKnownMinValue());
----------------
include the fixed-width value in the debug message?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109432



More information about the llvm-commits mailing list