[llvm] [SystemZ, LoopVectorizer] Enable vectorization of epilogue loops after VF16. (PR #172925)

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 20 08:30:14 PST 2026


================
@@ -4383,13 +4383,8 @@ bool LoopVectorizationCostModel::isEpilogueVectorizationProfitable(
   // account. For now we apply a very crude heuristic and only consider loops
   // with vectorization factors larger than a certain value.
 
-  // Allow the target to opt out entirely.
-  if (!TTI.preferEpilogueVectorization())
-    return false;
-
-  // We also consider epilogue vectorization unprofitable for targets that don't
-  // consider interleaving beneficial (eg. MVE).
-  if (TTI.getMaxInterleaveFactor(VF) <= 1)
+  // Allow the target to opt out.
+  if (!TTI.preferEpilogueVectorization(VF))
----------------
JonPsson1 wrote:

>From my perspective, the interesting fact has been VF, as a higher VF would indicate a more worthwhile epilogue vectorization, e.g. with VF=16 the epilogue might get VF=4. Not sure if IC would also affect the VF of the epilogue loop?

I would not want to change the current behavior everywhere by simply passing VF*IC. One option would then be to pass IC as a separate argument and ignore it for now. Would that make sense?


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


More information about the llvm-commits mailing list