[llvm] [VPlan] Only use selectVectorizationFactor for cross-check (NFCI). (PR #103033)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 18 03:48:56 PDT 2024


================
@@ -6995,11 +6994,11 @@ LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
       if (!hasPlanWithVF(UserVF)) {
         LLVM_DEBUG(dbgs() << "LV: No VPlan could be built for " << UserVF
                           << ".\n");
-        return std::nullopt;
+        return;
       }
 
       LLVM_DEBUG(printPlans(dbgs()));
-      return {{UserVF, 0, 0}};
+      return;
     } else
       reportVectorizationInfo("UserVF ignored because of invalid costs.",
                               "InvalidCost", ORE, OrigLoop);
----------------
ayalz wrote:

nit: while we're here, there's another "else" that seems to deserve reporting - that of `if (!UserVF.isZero() && UserVFIsLegal)` - in case UserVF is non zero but exceeds MaxUserVF, in which case UserVF is ignored silently. Would be clearer to check separately `if (UserVF.isNonZero())` (or simply if `(UserVF)`) and if so check if UserVF is legal, otherwise report. 

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


More information about the llvm-commits mailing list