[llvm] [LV][EpilogueTF] Exclude loops with recurrences or alias-masking (PR #224835)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 20 14:25:26 PDT 2026


================
@@ -3425,6 +3425,25 @@ getEpilogueTailLowering(const LoopVectorizationCostModel &MainCM, const Loop *L,
     return CM_EpilogueAllowed;
   }
 
+  if (ForcePartialAliasingVectorization) {
+    reportVectorizationInfo(
+        "Epilogue tail-folding is not supported with alias masking",
+        "InvalidTailFoldedEpilogue", ORE, L);
+    return CM_EpilogueAllowed;
+  }
+
+  if (!LVL.getReductionVars().empty()) {
+    reportVectorizationInfo(
+        "Epilogue tail-folding is not supported with reductions",
+        "InvalidTailFoldedEpilogue", ORE, L);
+    return CM_EpilogueAllowed;
+  }
+  if (!LVL.getFixedOrderRecurrences().empty()) {
+    reportVectorizationInfo(
+        "Epilogue tail-folding is not supported with fixed-order recurrence",
+        "InvalidTailFoldedEpilogue", ORE, L);
+    return CM_EpilogueAllowed;
+  }
   // We can apply tail-folding on the vectorized epilogue loop.
----------------
fhahn wrote:

nit: for consistency 
```suggestion
  }
  
  if (!LVL.getFixedOrderRecurrences().empty()) {
    reportVectorizationInfo(
        "Epilogue tail-folding is not supported with fixed-order recurrence",
        "InvalidTailFoldedEpilogue", ORE, L);
    return CM_EpilogueAllowed;
  }
  
// We can apply tail-folding on the vectorized epilogue loop.
```

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


More information about the llvm-commits mailing list