[llvm] b1e0aa3 - [VPlan] Remove asserts on VF and VFxUF users with EVL tail folding. NFC (#220545)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 05:10:28 PDT 2026


Author: Luke Lau
Date: 2026-09-02T20:10:22+08:00
New Revision: b1e0aa39763434060ab6e4dc87af3630ac9a04ac

URL: https://github.com/llvm/llvm-project/commit/b1e0aa39763434060ab6e4dc87af3630ac9a04ac
DIFF: https://github.com/llvm/llvm-project/commit/b1e0aa39763434060ab6e4dc87af3630ac9a04ac.diff

LOG: [VPlan] Remove asserts on VF and VFxUF users with EVL tail folding. NFC (#220545)

These asserts were added during the bringup of EVL tail folding, but
IIUC it was because we used to do replaceAllUsesWith,
https://github.com/llvm/llvm-project/commit/f01a7936bea491324e06dcf203749dda08ce7c07.
These days we only replace recipes which generate their own backedge
(widened induction recipes + scalarivsteps) via replaceUsesWithIf.

So the assert isn't really guarding against anything anymore, and is
becoming cumbersome to update (e.g. see
https://github.com/llvm/llvm-project/pull/171590), so this removes it.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp b/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
index 9d8e55137025f..c975b1fab87ca 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanEVLTailFolding.cpp
@@ -397,29 +397,10 @@ static void fixupVFUsersForEVL(VPlan &Plan, VPValue &EVL) {
           .createScalarZExtOrTrunc(&EVL, Plan.getVF().getScalarType(),
                                    DebugLoc::getUnknown());
 
-  assert(all_of(Plan.getVF().users(),
-                [&Plan](VPUser *U) {
-                  auto IsAllowedUser =
-                      IsaPred<VPVectorEndPointerRecipe, VPScalarIVStepsRecipe,
-                              VPWidenIntOrFpInductionRecipe,
-                              VPWidenMemIntrinsicRecipe>;
-                  if (match(U, m_Trunc(m_Specific(&Plan.getVF()))))
-                    return all_of(cast<VPSingleDefRecipe>(U)->users(),
-                                  IsAllowedUser);
-                  return IsAllowedUser(U);
-                }) &&
-         "User of VF that we can't transform to EVL.");
   Plan.getVF().replaceUsesWithIf(EVLAsIdx, [](VPUser &U, unsigned Idx) {
     return isa<VPWidenIntOrFpInductionRecipe, VPScalarIVStepsRecipe>(U);
   });
 
-  assert(all_of(Plan.getVFxUF().users(),
-                match_fn(m_CombineOr(
-                    m_c_Add(m_Specific(LoopRegion->getCanonicalIV()),
-                            m_Specific(&Plan.getVFxUF())),
-                    m_Isa<VPWidenPointerInductionRecipe>()))) &&
-         "Only users of VFxUF should be VPWidenPointerInductionRecipe and the "
-         "increment of the canonical induction.");
   Plan.getVFxUF().replaceUsesWithIf(EVLAsIdx, [](VPUser &U, unsigned Idx) {
     // Only replace uses in VPWidenPointerInductionRecipe; The increment of the
     // canonical induction must not be updated.


        


More information about the llvm-commits mailing list