[llvm] [LV] Vectorize Epilogues for loops with small VF but high IC (PR #108190)

Julian Nagele via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 03:28:26 PST 2024


================
@@ -4677,7 +4683,11 @@ VectorizationFactor LoopVectorizationPlanner::selectEpilogueVectorizationFactor(
     return Result;
   }
 
-  if (!CM.isEpilogueVectorizationProfitable(MainLoopVF)) {
+  unsigned Multiplier = IC;
+  if (MainLoopVF.isScalable())
+    Multiplier = getVScaleForTuning(OrigLoop, TTI).value_or(1);
----------------
juliannagele wrote:

Possibly, but I didn't really look at SVE and since the remaining part of this change depends on using `RemainingIterations` for checking profitability, which has an (existing) `// TODO: extend to support scalable VFs.` I'd rather keep changing behavior for SVE as a follow-up.

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


More information about the llvm-commits mailing list