[llvm] [LV]Initial support for safe distance in predicated DataWithEVL vectorization mode. (PR #102897)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 16:08:23 PDT 2024


================
@@ -4102,15 +4134,11 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
     if (Rem->isZero()) {
       // Accept MaxFixedVF if we do not have a tail.
       LLVM_DEBUG(dbgs() << "LV: No tail will remain for any chosen VF.\n");
+      disableTailFolding();
       return MaxFactors;
     }
   }
 
-  // If we don't know the precise trip count, or if the trip count that we
-  // found modulo the vectorization factor is not zero, try to fold the tail
-  // by masking.
-  // FIXME: look for a smaller MaxVF that does divide TC rather than masking.
-  setTailFoldingStyles(MaxFactors.ScalableVF.isScalable(), UserIC);
   if (foldTailByMasking()) {
----------------
ayalz wrote:

Following above mentioned thought, should the following correction for over-speculated `MaxFactors` take place in the `else`, `(!foldTailByMasking())` case - 
```
MaxFactors = computeFeasibleMaxVF(MaxTC, UserVF, false);
```
?

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


More information about the llvm-commits mailing list