[llvm] [VPlan] Permit more users in narrowToSingleScalars (PR #166559)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 7 06:21:09 PST 2025
================
@@ -1419,10 +1419,22 @@ 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 (auto *Store = dyn_cast<VPWidenStoreRecipe>(U)) {
+ // The assert must hold as we checked the RepOrWidenR operand
+ // against vputils::isSingleScalar.
+ assert(RepOrWidenR == Store->getAddr() ||
+ vputils::isSingleScalar(Store->getStoredValue()));
+ return true;
+ }
----------------
fhahn wrote:
I don't think the store can be narrowed the particular case I am thinking of, as the wide stores write to consecutive addresses in each iteration.
In any case, would be good to have such a test to confirm the impact of the current patch
https://github.com/llvm/llvm-project/pull/166559
More information about the llvm-commits
mailing list