[llvm] [LV][NFC] Fix "vectorization is possible but not beneficial" message (PR #228024)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 06:53:43 PDT 2026


================
@@ -7954,7 +7954,12 @@ bool LoopVectorizePass::processLoop(Loop *L) {
   std::pair<StringRef, std::string> VecDiagMsg, IntDiagMsg;
   bool VectorizeLoop = true, InterleaveLoop = true;
   if (VF.Width.isScalar()) {
-    LLVM_DEBUG(dbgs() << "LV: Vectorization is possible but not beneficial.\n");
+    if (LVP.hasVectorPlan())
+      LLVM_DEBUG(
+          dbgs() << "LV: Vectorization is possible but not beneficial.\n");
+    else
+      LLVM_DEBUG(dbgs() << "LV: Vectorization is not possible. Failed to "
+                           "create any vector vplans.\n");
     VecDiagMsg = {
         "VectorizationNotBeneficial",
         "the cost-model indicates that vectorization is not beneficial"};
----------------
david-arm wrote:

Good suggestion. While updating one of the tests I also realised the interleaving message is also incorrect. I've updated that too in the latest commit.

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


More information about the llvm-commits mailing list