[llvm] [LV] Consider interleaving & tail-folding when -enable-wide-lane-mask=true (PR #163387)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 16 02:54:10 PDT 2025


================
@@ -4518,7 +4531,7 @@ LoopVectorizationPlanner::selectInterleaveCount(VPlan &Plan, ElementCount VF,
   // 3. We don't interleave if we think that we will spill registers to memory
   // due to the increased register pressure.
 
-  if (!CM.isScalarEpilogueAllowed())
+  if (!CM.isScalarEpilogueAllowed() && !CM.useWideActiveLaneMask())
----------------
fhahn wrote:

This deserves some explanation, why `useWideActiveLaneMask` should be treated differently. This check may serve as proxy for optimizing for size. Could you add a test to make sure we do not interleave with wide active lane masks when optimizing for size?

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


More information about the llvm-commits mailing list