summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <flo@fhahn.com>2025-06-27 15:42:41 +0100
committerFlorian Hahn <flo@fhahn.com>2025-06-27 15:42:42 +0100
commit3b7b95f78e24aca5175b8f864bfea2953a2dd34f (patch)
tree070dab20bdb86214ad9b06365c18a40535f2f9d8 /llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
parent1df3e0a275bd238949121e4103d2c975054737c5 (diff)
[VPlan] Support VPWidenSelectRecipe in narrowToSingleScalar.
VPWidenSelectRecipes are single scalars if all their operands are. Add support for narrowing them to a single scalar VPReplicateRecipe. This fixes a crash after https://github.com/llvm/llvm-project/pull/142433 (aa24029319083) when due to a replicate recipe not being converted to single-scalar being hoisted to the vector preheader.
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
index 87bb79c769b8..962c789884b5 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
@@ -1221,7 +1221,7 @@ static void narrowToSingleScalarRecipes(VPlan &Plan) {
vp_depth_first_shallow(Plan.getVectorLoopRegion()->getEntry()))) {
for (VPRecipeBase &R : make_early_inc_range(reverse(*VPBB))) {
auto *RepR = dyn_cast<VPReplicateRecipe>(&R);
- if (!RepR && !isa<VPWidenRecipe>(&R))
+ if (!RepR && !isa<VPWidenRecipe, VPWidenSelectRecipe>(&R))
continue;
if (RepR && (RepR->isSingleScalar() || RepR->isPredicated()))
continue;