[llvm] a51e2ef - [VPlan] Treat VPVector(End)PointerRecipe as single-scalar, if ops are. (#169249)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 25 06:46:34 PST 2025


Author: Florian Hahn
Date: 2025-11-25T14:46:30Z
New Revision: a51e2ef0fe73dd9ab6e608304ddf2b489c350cf4

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

LOG: [VPlan] Treat VPVector(End)PointerRecipe as single-scalar, if ops are. (#169249)

VPVector(End)PointerRecipes are single-scalar if all their operands are.
This should be effectively NFC currently, but it should re-enable cost
checking for some more VPWidenMemoryRecipe after
https://github.com/llvm/llvm-project/pull/157387 as discovered by
John Brawn.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
index 939216fe162a4..839a304904e8b 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
@@ -197,7 +197,8 @@ bool vputils::isSingleScalar(const VPValue *VPV) {
             all_of(VPI->operands(), isSingleScalar));
   if (isa<VPPartialReductionRecipe>(VPV))
     return false;
-  if (isa<VPReductionRecipe>(VPV))
+  if (isa<VPReductionRecipe, VPVectorPointerRecipe, VPVectorEndPointerRecipe>(
+          VPV))
     return true;
   if (auto *Expr = dyn_cast<VPExpressionRecipe>(VPV))
     return Expr->isSingleScalar();


        


More information about the llvm-commits mailing list