================
@@ -5911,33 +5937,32 @@ std::pair<VectorizationFactor, VPlan *> 
LoopVectorizationPlanner::computeBestVF(
         continue;
       }
 
-      assert(P->isCompatibleWithTF(CM.foldTailByMasking()) &&
-             "All vplans must be compatible with the CM");
-      InstructionCost Cost =
-          cost(*P, VF, ConsiderRegPressure ? &RUs[I] : nullptr, CM);
-      VectorizationFactor CurrentFactor(VF, Cost, ScalarCost);
-
-      if (isMoreProfitable(CurrentFactor, BestFactor, P->hasScalarTail())) {
-        BestFactor = CurrentFactor;
-        PlanForBestVF = P.get();
-      }
+      if (P->isCompatibleWithTF(CM.foldTailByMasking())) {
+        InstructionCost Cost =
+            cost(*P, VF, ConsiderRegPressure ? &RUs[I] : nullptr, CM);
+        VectorizationFactor CurrentFactor(VF, Cost, ScalarCost);
 
-      // If profitable add it to ProfitableVF list.
-      if (isMoreProfitable(CurrentFactor, ScalarFactor, P->hasScalarTail()))
-        ProfitableVFs.push_back(CurrentFactor);
+        if (isMoreProfitable(CurrentFactor, BestFactor, P->hasScalarTail())) {
+          BestFactor = CurrentFactor;
+          PlanForBestVF = P.get();
+        }
 
-      if (EpilogueTailFoldingCM) {
-        // Get the costs for the EpilogueTailFoldingCM:
+        // If profitable add it to ProfitableVF list.
+        if (isMoreProfitable(CurrentFactor, ScalarFactor, P->hasScalarTail()))
+          ProfitableVFs.push_back(CurrentFactor);
+      }
+      // Get the costs for the EpilogueTailFoldingCM:
+      if (EpilogueTailFoldingCM &&
+          P->isCompatibleWithTF(EpilogueTailFoldingCM->foldTailByMasking())) {
----------------
sdesmalen-arm wrote:

Can you rebase to make use of `hasTailFolded`?

https://github.com/llvm/llvm-project/pull/207815
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to