[llvm] [LV][EVL] Add dead EVL mask into ToErase for consistency. nfc (PR #153761)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 15 00:58:45 PDT 2025


https://github.com/Mel-Chen created https://github.com/llvm/llvm-project/pull/153761

None

>From 4c8b55fd08f59ca8a3b35275a50628fd787aaa47 Mon Sep 17 00:00:00 2001
From: Mel Chen <mel.chen at sifive.com>
Date: Fri, 15 Aug 2025 00:44:58 -0700
Subject: [PATCH] Post-comment, align ththe remove way

---
 llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 22e02abf229d7..e534da813fe5a 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -2296,7 +2296,7 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
   }
   // Remove dead EVL mask.
   if (EVLMask->getNumUsers() == 0)
-    EVLMask->getDefiningRecipe()->eraseFromParent();
+    ToErase.push_back(EVLMask->getDefiningRecipe());
 
   for (VPRecipeBase *R : reverse(ToErase)) {
     SmallVector<VPValue *> PossiblyDead(R->operands());



More information about the llvm-commits mailing list