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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 23 14:15:50 PST 2025


https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/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-arm.

>From edfe9b61156815dcc4b5f95e2ea1ef527461b550 Mon Sep 17 00:00:00 2001
From: Florian Hahn <flo at fhahn.com>
Date: Sun, 23 Nov 2025 22:11:38 +0000
Subject: [PATCH] [VPlan] Treat VPVector(End)PointerRecipe as single-scalar, if
 ops are.

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-arm.
---
 llvm/lib/Transforms/Vectorize/VPlanUtils.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
index 939216fe162a4..334ad973c5428 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
@@ -185,7 +185,8 @@ bool vputils::isSingleScalar(const VPValue *VPV) {
                                      all_of(Rep->operands(), isSingleScalar));
   }
   if (isa<VPWidenGEPRecipe, VPDerivedIVRecipe, VPBlendRecipe,
-          VPWidenSelectRecipe>(VPV))
+          VPWidenSelectRecipe, VPVectorPointerRecipe, VPVectorEndPointerRecipe>(
+          VPV))
     return all_of(VPV->getDefiningRecipe()->operands(), isSingleScalar);
   if (auto *WidenR = dyn_cast<VPWidenRecipe>(VPV)) {
     return preservesUniformity(WidenR->getOpcode()) &&



More information about the llvm-commits mailing list