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

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 09:02:25 PDT 2024


================
@@ -7031,11 +7030,10 @@ LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
         if (!hasPlanWithVF(UserVF)) {
           LLVM_DEBUG(dbgs()
                      << "LV: No VPlan could be built for " << UserVF << ".\n");
-          return std::nullopt;
         }
 
         LLVM_DEBUG(printPlans(dbgs()));
-        return {{UserVF, 0, 0}};
+        return;
----------------
ayalz wrote:

As @alexey-bataev noted, `else` should be dropped after `return` (can be done independently). OTOH, perhaps it's better to treat the simpler additional "report UserVF ignored" case first - `if (!CM.selectUserVectorizationFactor(UserVF))` - otherwise build a VPlan for UserVF and return.

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


More information about the llvm-commits mailing list