[llvm] [LV, VP]VP intrinsics support for the Loop Vectorizer + adding new tail-folding mode using EVL. (PR #76172)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 07:26:22 PST 2024


================
@@ -4728,6 +4740,47 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
   // FIXME: look for a smaller MaxVF that does divide TC rather than masking.
   if (Legal->prepareToFoldTailByMasking()) {
     CanFoldTailByMasking = true;
+    if (getTailFoldingStyle() == TailFoldingStyle::DataWithEVL) {
+      assert(!ChosenTailFoldingStyle &&
----------------
fhahn wrote:

Better to move this to its own helper (e.g. `selectTailFoldingStyle`), have to called before computeMaxVF and move all logic related to selecting the tail-folding style there, so that `getTailFoldingStyle()` is simplify a return of the selected style? Would be good to do this refactoring in a separate PR

https://github.com/llvm/llvm-project/pull/76172


More information about the llvm-commits mailing list