[llvm] [VPlan] Permit more users in narrowToSingleScalars (PR #166559)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 5 08:23:22 PST 2025
================
@@ -1411,10 +1412,14 @@ static void narrowToSingleScalarRecipes(VPlan &Plan) {
// broadcasts.
if (!vputils::isSingleScalar(RepOrWidenR) ||
!all_of(RepOrWidenR->users(), [RepOrWidenR](const VPUser *U) {
- return U->usesScalars(RepOrWidenR) ||
- match(cast<VPRecipeBase>(U),
- m_CombineOr(m_ExtractLastElement(m_VPValue()),
- m_ExtractLastLanePerPart(m_VPValue())));
+ if (isa<VPWidenStoreRecipe>(U))
+ return true;
+
+ if (auto *VPI = dyn_cast<VPInstruction>(U))
+ if (VPI->isVectorToScalar() || VPI->isSingleScalar())
----------------
artagnon wrote:
I've been thinking about a vputils::isDirectlySingleScalar, which is probably the generalization; it would basically be an extension of this: we'd also include VPReplicateRecipe::isSingleScalar and VPExpressionRecipe::isSingleScalar.
https://github.com/llvm/llvm-project/pull/166559
More information about the llvm-commits
mailing list