[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:51:40 PDT 2026


https://github.com/david-arm updated https://github.com/llvm/llvm-project/pull/228024

>From 9305f5ebb7771b69be97e92842b7aee3ecb04b37 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Thu, 1 Oct 2026 10:26:08 +0000
Subject: [PATCH 1/5] [LV][NFC] Fix "vectorization is possible but not
 beneficial" message

---
 llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h   | 5 +++++
 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp            | 7 ++++++-
 .../Transforms/LoopVectorize/AArch64/early_exit_costs.ll   | 2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index 733b8647a06e34b..2a38d125e68d966 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -946,6 +946,11 @@ class LoopVectorizationPlanner {
   /// Destroy the cost model.
   void clearCostModel();
 
+  bool hasVectorPlan() const {
+    return any_of(
+        VPlans, [&](const VPlanPtr &Plan) { return !Plan->hasScalarVFOnly(); });
+  }
+
   /// Build VPlans for the specified \p UserVF and \p UserIC if they are
   /// non-zero or all applicable candidate VFs otherwise. If vectorization and
   /// interleaving should be avoided up-front, no plans are generated.
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index b3db2f8de743274..f50d8f8e0d25ef7 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -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 not possible. Failed to "
+                           "create any vector vplans.\n");
+    else
+      LLVM_DEBUG(
+          dbgs() << "LV: Vectorization is possible but not beneficial.\n");
     VecDiagMsg = {
         "VectorizationNotBeneficial",
         "the cost-model indicates that vectorization is not beneficial"};
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll b/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll
index 8dd7ca897172477..1a33b66c3e5779e 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll
@@ -91,7 +91,7 @@ loop.end:
 define i64 @vectorization_not_profitable_due_to_trunc(ptr dereferenceable(800) %src) {
 ; CHECK-LABEL: LV: Checking a loop in 'vectorization_not_profitable_due_to_trunc'
 ; CHECK: LV: Selecting VF: 1.
-; CHECK: LV: Vectorization is possible but not beneficial.
+; CHECK: LV: Vectorization is not possible. Failed to create any vector vplans.
 entry:
   br label %loop.header
 

>From 1daa91876a1990678bcaf2c8f707361671c6dc71 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Thu, 1 Oct 2026 11:51:58 +0000
Subject: [PATCH 2/5] Fix silly mistake with ordering

---
 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp            | 7 +++----
 .../Transforms/LoopVectorize/AArch64/early_exit_costs.ll   | 2 +-
 .../Transforms/LoopVectorize/early_exit_store_legality.ll  | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index f50d8f8e0d25ef7..3ffa6412f4bf22c 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5342,7 +5342,6 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
 void LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
   CM->collectValuesToIgnore();
   Config.collectElementTypesForWidening(&CM->ValuesToIgnore);
-
   FixedScalableVFPair MaxFactors = CM->computeMaxVF(UserVF, UserIC);
   if (!MaxFactors) // Cases that should not to be vectorized nor interleaved.
     return;
@@ -7955,11 +7954,11 @@ bool LoopVectorizePass::processLoop(Loop *L) {
   bool VectorizeLoop = true, InterleaveLoop = true;
   if (VF.Width.isScalar()) {
     if (LVP.hasVectorPlan())
-      LLVM_DEBUG(dbgs() << "LV: Vectorization is not possible. Failed to "
-                           "create any vector vplans.\n");
-    else
       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"};
diff --git a/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll b/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll
index 1a33b66c3e5779e..8dd7ca897172477 100644
--- a/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/AArch64/early_exit_costs.ll
@@ -91,7 +91,7 @@ loop.end:
 define i64 @vectorization_not_profitable_due_to_trunc(ptr dereferenceable(800) %src) {
 ; CHECK-LABEL: LV: Checking a loop in 'vectorization_not_profitable_due_to_trunc'
 ; CHECK: LV: Selecting VF: 1.
-; CHECK: LV: Vectorization is not possible. Failed to create any vector vplans.
+; CHECK: LV: Vectorization is possible but not beneficial.
 entry:
   br label %loop.header
 
diff --git a/llvm/test/Transforms/LoopVectorize/early_exit_store_legality.ll b/llvm/test/Transforms/LoopVectorize/early_exit_store_legality.ll
index 714f172d08fbffd..8a7e140aa04e183 100644
--- a/llvm/test/Transforms/LoopVectorize/early_exit_store_legality.ll
+++ b/llvm/test/Transforms/LoopVectorize/early_exit_store_legality.ll
@@ -895,7 +895,7 @@ define i32 @uncountable_exit_with_masked_ldst_separate_condition(ptr dereference
 ; CHECK-DEBUG-LABEL: LV: Checking a loop in 'uncountable_exit_with_masked_ldst_separate_condition'
 ; CHECK-DEBUG:       LV: Loop passed LoopVectorizationLegality checks!
 ; CHECK-DEBUG:       LV: Not vectorizing: Early exit loop with side effects contains unsupported conditional memory operations
-; CHECK-DEBUG:       LV: Vectorization is possible but not beneficial.
+; CHECK-DEBUG:       LV: Vectorization is not possible. Failed to create any vector vplans.
 ; CHECK-REMARK:      foo.c:290:3: loop not vectorized: Early exit loop with side effects contains unsupported conditional memory operations
 entry:
   br label %for.body, !dbg !67

>From 969fc061379dc00460520a481dafd76ce6843d70 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Thu, 1 Oct 2026 14:11:22 +0000
Subject: [PATCH 3/5] Address review comments

---
 .../Transforms/Vectorize/LoopVectorize.cpp    |  3 +-
 .../Vectorize/VPlanConstruction.cpp           |  8 +++-
 .../Transforms/Vectorize/VPlanTransforms.h    |  2 +-
 .../LoopVectorize/fail_vectorise_no_vplans.ll | 48 +++++++++++++++++++
 4 files changed, 57 insertions(+), 4 deletions(-)
 create mode 100644 llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 3ffa6412f4bf22c..429f30e703a77f8 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5342,6 +5342,7 @@ void LoopVectorizationCostModel::collectValuesToIgnore() {
 void LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
   CM->collectValuesToIgnore();
   Config.collectElementTypesForWidening(&CM->ValuesToIgnore);
+
   FixedScalableVFPair MaxFactors = CM->computeMaxVF(UserVF, UserIC);
   if (!MaxFactors) // Cases that should not to be vectorized nor interleaved.
     return;
@@ -6419,7 +6420,7 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan1() {
   // Create recipes for header phis. For outer loops, reductions, recurrences
   // and in-loop reductions are empty since legality doesn't detect them.
   if (!RUN_VPLAN_PASS(
-          VPlanTransforms::createHeaderPhiRecipes, *VPlan0, PSE, *OrigLoop,
+          VPlanTransforms::createHeaderPhiRecipes, *VPlan0, PSE, *OrigLoop, ORE,
           VPDT, Legal->getInductionVars(), Legal->getReductionVars(),
           Legal->getFixedOrderRecurrences(), Config.getInLoopReductions(),
           Config.getHints().allowReordering())) {
diff --git a/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp b/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
index 43bd85513ce251b..9b393a1270d79fc 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
@@ -937,7 +937,7 @@ static bool tryToSinkOrHoistRecurrenceUsers(VPBasicBlock *HeaderVPBB,
 
 bool VPlanTransforms::createHeaderPhiRecipes(
     VPlan &Plan, PredicatedScalarEvolution &PSE, Loop &OrigLoop,
-    const VPDominatorTree &VPDT,
+    OptimizationRemarkEmitter *ORE, const VPDominatorTree &VPDT,
     const MapVector<PHINode *, InductionDescriptor> &Inductions,
     const MapVector<PHINode *, RecurrenceDescriptor> &Reductions,
     const SmallPtrSetImpl<const PHINode *> &FixedOrderRecurrences,
@@ -997,8 +997,12 @@ bool VPlanTransforms::createHeaderPhiRecipes(
     PhiR->eraseFromParent();
   }
 
-  if (!tryToSinkOrHoistRecurrenceUsers(HeaderVPBB, VPDT))
+  if (!tryToSinkOrHoistRecurrenceUsers(HeaderVPBB, VPDT)) {
+    reportVectorizationFailure(
+        "Failed to sink or hoist user of first-order recurrence",
+        "CannotSinkHoistFORUser", ORE, &OrigLoop);
     return false;
+  }
 
   // Skip renaming resume phi recipes, if any header phi has been removed.
   if (range_size(HeaderVPBB->phis()) !=
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
index 30d584ab8f589cf..07f1f8563ee76a9 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h
@@ -172,7 +172,7 @@ struct VPlanTransforms {
   /// recurrence cannot be handled.
   LLVM_ABI_FOR_TEST static bool createHeaderPhiRecipes(
       VPlan &Plan, PredicatedScalarEvolution &PSE, Loop &OrigLoop,
-      const VPDominatorTree &VPDT,
+      OptimizationRemarkEmitter *ORE, const VPDominatorTree &VPDT,
       const MapVector<PHINode *, InductionDescriptor> &Inductions,
       const MapVector<PHINode *, RecurrenceDescriptor> &Reductions,
       const SmallPtrSetImpl<const PHINode *> &FixedOrderRecurrences,
diff --git a/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll b/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll
new file mode 100644
index 000000000000000..1962ba32fa4f50d
--- /dev/null
+++ b/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll
@@ -0,0 +1,48 @@
+; REQUIRES: asserts
+; RUN: opt -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -S -disable-output \
+; RUN:   -debug-only=loop-vectorize %s 2>&1 | FileCheck %s
+
+; This is testing that we emit more accurate debug messages when we
+; fail to vectorize because we didn't create any vector vplans. Essentially,
+; we are doing legalisation in vplan more often for things that used to
+; happen in LoopVectorizationLegality.
+define void @fail_vplan_bad_users_of_for(ptr noalias %A, ptr noalias %B, ptr noalias %C, i64 %n) {
+; CHECK: Checking a loop in 'fail_vplan_bad_users_of_for'
+; CHECK: LV: Not vectorizing: Failed to sink or hoist user of first-order recurrence.
+; CHECK-NEXT: LV: Vectorization is not possible. Failed to create any vector vplans.
+entry:
+  br label %loop
+
+loop:
+  %iv = phi i64 [ 0, %entry ], [ %iv.next, %loop.latch ]
+  %for.1 = phi i32 [ 0, %entry ], [ %prev, %loop.latch ]
+  %for.2 = phi i32 [ 0, %entry ], [ %or, %loop.latch ]
+  %or = or i32 %for.1, 3
+  %t = trunc i64 %iv to i32
+  %gep.c = getelementptr inbounds i32, ptr %C, i64 %iv
+  %c = load i32, ptr %gep.c, align 4
+  %cmp = icmp sgt i32 %c, 0
+  br i1 %cmp, label %then, label %else
+
+then:
+  %gep.a = getelementptr inbounds i32, ptr %A, i64 %iv
+  store i32 %for.2, ptr %gep.a, align 4
+  br label %merge
+
+else:
+  %gep.b = getelementptr inbounds i32, ptr %B, i64 %iv
+  store i32 %for.2, ptr %gep.b, align 4
+  br label %merge
+
+merge:
+  %prev = mul i32 %t, %t
+  br label %loop.latch
+
+loop.latch:
+  %iv.next = add i64 %iv, 1
+  %ec = icmp eq i64 %iv.next, %n
+  br i1 %ec, label %exit, label %loop
+
+exit:
+  ret void
+}

>From 31c32d0289c2f9545fd470e476b13482c4060baf Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Fri, 2 Oct 2026 11:59:00 +0000
Subject: [PATCH 4/5] Fix build failures

---
 llvm/unittests/Transforms/Vectorize/VPlanTestBase.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h b/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
index 6f6200e8e20745a..63bcc3ca24910a0 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
+++ b/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h
@@ -89,6 +89,7 @@ class VPlanTestIRBase : public testing::Test {
         L, *LI, IntegerType::get(*Ctx, 64), PSE, /*LVer=*/nullptr,
         [this]() -> const BranchProbabilityInfo & { return *BPI; });
 
+    OptimizationRemarkEmitter ORE(&F);
     if (Style) {
       Inductions.clear();
       // handleUncountableEarlyExits requires induction phi recipes.
@@ -99,17 +100,16 @@ class VPlanTestIRBase : public testing::Test {
       }
       VPDominatorTree VPDT(*Plan);
       VPlanTransforms::createHeaderPhiRecipes(
-          *Plan, PSE, *L, VPDT, Inductions,
+          *Plan, PSE, *L, &ORE, VPDT, Inductions,
           MapVector<PHINode *, RecurrenceDescriptor>(),
           SmallPtrSet<const PHINode *, 1>(), SmallPtrSet<PHINode *, 1>(),
           /*AllowReordering=*/false);
     }
 
-    if (Style) {
-      OptimizationRemarkEmitter ORE(&F);
+    if (Style)
       VPlanTransforms::handleUncountableEarlyExits(*Plan, &ORE, L, PSE, *DT,
                                                    AC.get(), *Style);
-    } else
+    else
       VPlanTransforms::handleCountableEarlyExits(*Plan);
     VPlanTransforms::addMiddleCheck(*Plan);
 

>From 64c705cf3d3b7312df2cdd6ee00031bd9758ed43 Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Fri, 2 Oct 2026 13:50:38 +0000
Subject: [PATCH 5/5] Address review comments

---
 .../Vectorize/LoopVectorizationPlanner.h      |  4 ++
 .../Transforms/Vectorize/LoopVectorize.cpp    | 37 ++++++++++++-------
 .../LoopVectorize/conditional-assignment.ll   |  2 +-
 .../LoopVectorize/fail_vectorise_no_vplans.ll | 11 +++---
 .../Transforms/LoopVectorize/invalid-costs.ll |  4 +-
 5 files changed, 36 insertions(+), 22 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index 2a38d125e68d966..2cf9cf39f5bd6df 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -946,11 +946,15 @@ class LoopVectorizationPlanner {
   /// Destroy the cost model.
   void clearCostModel();
 
+  /// Return true if there is at least one VPlan for a vector VF
   bool hasVectorPlan() const {
     return any_of(
         VPlans, [&](const VPlanPtr &Plan) { return !Plan->hasScalarVFOnly(); });
   }
 
+  /// Returns true if there is at least one VPlan.
+  bool hasAPlan() const { return !VPlans.empty(); }
+
   /// Build VPlans for the specified \p UserVF and \p UserIC if they are
   /// non-zero or all applicable candidate VFs otherwise. If vectorization and
   /// interleaving should be avoided up-front, no plans are generated.
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 429f30e703a77f8..dd6896c0edc6da6 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -7954,15 +7954,18 @@ bool LoopVectorizePass::processLoop(Loop *L) {
   std::pair<StringRef, std::string> VecDiagMsg, IntDiagMsg;
   bool VectorizeLoop = true, InterleaveLoop = true;
   if (VF.Width.isScalar()) {
-    if (LVP.hasVectorPlan())
+    if (LVP.hasVectorPlan()) {
       LLVM_DEBUG(
           dbgs() << "LV: Vectorization is possible but not beneficial.\n");
-    else
+      VecDiagMsg = {
+          "VectorizationNotBeneficial",
+          "the cost-model indicates that vectorization is not beneficial"};
+    } 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"};
+      VecDiagMsg = {"VectorizationNotPossible",
+                    "vectorization is not possible"};
+    }
     VectorizeLoop = false;
   }
 
@@ -7984,16 +7987,22 @@ bool LoopVectorizePass::processLoop(Loop *L) {
     InterleaveLoop = false;
   } else if (IC == 1 && UserIC <= 1) {
     // Tell the user interleaving is not beneficial.
-    LLVM_DEBUG(dbgs() << "LV: Interleaving is not beneficial.\n");
-    IntDiagMsg = {
-        "InterleavingNotBeneficial",
-        "the cost-model indicates that interleaving is not beneficial"};
-    InterleaveLoop = false;
-    if (UserIC == 1) {
-      IntDiagMsg.first = "InterleavingNotBeneficialAndDisabled";
-      IntDiagMsg.second +=
-          " and is explicitly disabled or interleave count is set to 1";
+    if (LVP.hasAPlan()) {
+      LLVM_DEBUG(dbgs() << "LV: Interleaving is not beneficial.\n");
+      IntDiagMsg = {
+          "InterleavingNotBeneficial",
+          "the cost-model indicates that interleaving is not beneficial"};
+      if (UserIC == 1) {
+        IntDiagMsg.first = "InterleavingNotBeneficialAndDisabled";
+        IntDiagMsg.second +=
+            " and is explicitly disabled or interleave count is set to 1";
+      }
+    } else {
+      LLVM_DEBUG(dbgs() << "LV: Interleaving is not possible. Failed to create"
+                        << " any vplans\n");
+      IntDiagMsg = {"InterleavingNotPossible", "interleaving is not possible"};
     }
+    InterleaveLoop = false;
   } else if (IC > 1 && UserIC == 1) {
     // Tell the user interleaving is beneficial, but it explicitly disabled.
     LLVM_DEBUG(dbgs() << "LV: Interleaving is beneficial but is explicitly "
diff --git a/llvm/test/Transforms/LoopVectorize/conditional-assignment.ll b/llvm/test/Transforms/LoopVectorize/conditional-assignment.ll
index 7f6a1b559baffae..01b62cdf3e63587 100644
--- a/llvm/test/Transforms/LoopVectorize/conditional-assignment.ll
+++ b/llvm/test/Transforms/LoopVectorize/conditional-assignment.ll
@@ -1,6 +1,6 @@
 ; RUN: opt < %s -passes=loop-vectorize -S -pass-remarks-missed='loop-vectorize' -pass-remarks-analysis='loop-vectorize' 2>&1 | FileCheck %s
 
-; CHECK: remark: source.c:2:8: the cost-model indicates that vectorization is not beneficial
+; CHECK: remark: source.c:2:8: vectorization is not possible
 
 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
 
diff --git a/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll b/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll
index 1962ba32fa4f50d..43c35320ae72535 100644
--- a/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll
+++ b/llvm/test/Transforms/LoopVectorize/fail_vectorise_no_vplans.ll
@@ -1,15 +1,14 @@
-; REQUIRES: asserts
 ; RUN: opt -passes=loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -S -disable-output \
-; RUN:   -debug-only=loop-vectorize %s 2>&1 | FileCheck %s
+; RUN:   -pass-remarks-analysis=loop-vectorize -pass-remarks-missed=loop-vectorize %s 2>&1 | FileCheck %s
 
 ; This is testing that we emit more accurate debug messages when we
 ; fail to vectorize because we didn't create any vector vplans. Essentially,
-; we are doing legalisation in vplan more often for things that used to
+; we are doing legalisation in VPlan more often for things that used to
 ; happen in LoopVectorizationLegality.
 define void @fail_vplan_bad_users_of_for(ptr noalias %A, ptr noalias %B, ptr noalias %C, i64 %n) {
-; CHECK: Checking a loop in 'fail_vplan_bad_users_of_for'
-; CHECK: LV: Not vectorizing: Failed to sink or hoist user of first-order recurrence.
-; CHECK-NEXT: LV: Vectorization is not possible. Failed to create any vector vplans.
+; CHECK: remark: <unknown>:0:0: loop not vectorized: Failed to sink or hoist user of first-order recurrence
+; CHECK: remark: <unknown>:0:0: vectorization is not possible
+; CHECK: remark: <unknown>:0:0: interleaving is not possible
 entry:
   br label %loop
 
diff --git a/llvm/test/Transforms/LoopVectorize/invalid-costs.ll b/llvm/test/Transforms/LoopVectorize/invalid-costs.ll
index 757d9e75a339b2d..0ec70e4a3175c96 100644
--- a/llvm/test/Transforms/LoopVectorize/invalid-costs.ll
+++ b/llvm/test/Transforms/LoopVectorize/invalid-costs.ll
@@ -2,7 +2,9 @@
 ; RUN: opt -passes="loop-vectorize" -pass-remarks-output=%t.yaml -S %s | FileCheck %s
 ; RUN: FileCheck --input-file=%t.yaml --check-prefix=REMARKS %s
 
-; REMARKS: the cost-model indicates that vectorization is not beneficial
+; NOTE: The reason we cannot vectorise this test is because the target has no
+; vector registers.
+; REMARKS: vectorization is not possible
 
 ; Test for https://github.com/llvm/llvm-project/issues/116375.
 define void @test_i24_load_for(ptr noalias %src, ptr %dst) {



More information about the llvm-commits mailing list