[llvm] [VPlan] Simplify EVL strided load match in optimizeMaskToEVL. nfc (PR #211193)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 22 00:49:56 PDT 2026


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

None

>From ae70cd5c68490893ecc4de08e186a2b1ed431bca Mon Sep 17 00:00:00 2001
From: Mel Chen <mel.chen at sifive.com>
Date: Wed, 22 Jul 2026 00:40:07 -0700
Subject: [PATCH] [VPlan] Simplify EVL strided load match in optimizeMaskToEVL.
 nfc

---
 .../Transforms/Vectorize/VPlanEVLTailFolding.cpp    | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp b/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
index cc55d766ba596..fab0765083d6f 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
@@ -154,15 +154,12 @@ static VPRecipeBase *optimizeMaskToEVL(VPValue *HeaderMask,
                                       LoadR->getScalarType(), {}, {}, DL);
   }
 
-  VPValue *Stride;
-  if (match(&CurRecipe, m_Intrinsic<Intrinsic::experimental_vp_strided_load>(
-                            m_VPValue(Addr), m_VPValue(Stride),
-                            m_RemoveMask(HeaderMask, Mask),
-                            m_TruncOrSelf(m_Specific(&Plan->getVF()))))) {
-    if (!Mask)
-      Mask = Plan->getTrue();
+  if (match(&CurRecipe,
+            m_Intrinsic<Intrinsic::experimental_vp_strided_load>(
+                m_VPValue(), m_VPValue(), m_RemoveMask(HeaderMask, Mask),
+                m_TruncOrSelf(m_Specific(&Plan->getVF()))))) {
     auto *NewLoad = cast<VPWidenMemIntrinsicRecipe>(&CurRecipe)->clone();
-    NewLoad->setOperand(2, Mask);
+    NewLoad->setOperand(2, Mask ? Mask : Plan->getTrue());
     NewLoad->setOperand(3, &EVL);
     return NewLoad;
   }



More information about the llvm-commits mailing list