[llvm] [VPlan] Strip bad assert in VPTransformState::get (NFC) (PR #166145)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 02:19:39 PST 2025


https://github.com/artagnon created https://github.com/llvm/llvm-project/pull/166145

The assert only currently holds by chance, as vputils::isSingleScalar handles a lot more recipes.

>From 73c7ba2b641aeb9745a624418c08da448bc82189 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <ramkumar.ramachandra at codasip.com>
Date: Mon, 3 Nov 2025 10:16:40 +0000
Subject: [PATCH] [VPlan] Strip bad assert in VPTransformState::get (NFC)

The assert only currently holds by chance, as vputils::isSingleScalar
handles a lot more recipes.
---
 llvm/lib/Transforms/Vectorize/VPlan.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 428a8f4c1348f..5b712d796496a 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -308,11 +308,6 @@ Value *VPTransformState::get(const VPValue *Def, bool NeedsScalar) {
   VPLane LastLane(IsSingleScalar ? 0 : VF.getFixedValue() - 1);
   // Check if there is a scalar value for the selected lane.
   if (!hasScalarValue(Def, LastLane)) {
-    // At the moment, VPWidenIntOrFpInductionRecipes, VPScalarIVStepsRecipes and
-    // VPExpandSCEVRecipes can also be a single scalar.
-    assert((isa<VPWidenIntOrFpInductionRecipe, VPScalarIVStepsRecipe,
-                VPExpandSCEVRecipe>(Def->getDefiningRecipe())) &&
-           "unexpected recipe found to be invariant");
     IsSingleScalar = true;
     LastLane = 0;
   }



More information about the llvm-commits mailing list