[PATCH] D93063: [LV] Disable epilogue vectorization for scalable VFs

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 13:23:39 PST 2020


bmahjour added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5778
+  // vectors when the loop has a hint to enable vectorization for a given VF.
+  assert(!MainLoopVF.isScalable() && "scalable vectors not yet supported");
+
----------------
We can just return `Result` around line 5792 (please see suggestion below), then we don't need to change the check near line 9209.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5792
   }
 
   // Not really a cost consideration, but check for unsupported cases here to
----------------
```
// FIXME: This can be fixed for scalable vectors later, because at this stage
// the LoopVectorizer will only consider vectorizing a loop with scalable
// vectors when the loop has a hint to enable vectorization for a given VF.
if (MainLoopVF.isScalable()) {
  LLVM_DEBUG(dbgs() << "LEV: Epilogue vectorization for scalable vectors not yet supported.\n");
  return Result;
}
```


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9210
     VectorizationFactor EpilogueVF =
-      CM.selectEpilogueVectorizationFactor(VF.Width, LVP);
-    if (EpilogueVF.Width.isVector()) {
+        VF.Width.isScalable()
+            ? VectorizationFactor::Disabled()
----------------
please see comment above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93063



More information about the llvm-commits mailing list