[llvm] ad58ea3 - [VPlan] Bail out before construction VPlan0 if MinVF > MaxVF.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue May 27 13:19:37 PDT 2025


Author: Florian Hahn
Date: 2025-05-27T21:19:11+01:00
New Revision: ad58ea3ba8b9ab60a3b31316cb2010034f6257e3

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

LOG: [VPlan] Bail out before construction VPlan0 if MinVF > MaxVF.

This reduces the cases where we need to create initial VPlans
unnecessarily after 567b3172da2d52f5df70a37f3de06b7000b25968.

buildVPlansWithVPRecipes is called with MinVF > MaxVF if the target does
not support scalable vectors.

Recovers some of the compile-time impact
http://llvm-compile-time-tracker.com/compare.php?from=3033f202f6707937cd28c2473479db134993f96f&to=1a0b9e5834f7fd4abf058864e656f8e26b7a26ff&stat=instructions:u

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 4f305bb383465..2fe59a464457f 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -8708,6 +8708,9 @@ VPRecipeBuilder::tryToCreatePartialReduction(Instruction *Reduction,
 
 void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
                                                         ElementCount MaxVF) {
+  if (ElementCount::isKnownGT(MinVF, MaxVF))
+    return;
+
   assert(OrigLoop->isInnermost() && "Inner loop expected.");
 
   const LoopAccessInfo *LAI = Legal->getLAI();


        


More information about the llvm-commits mailing list