File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,16 @@ bool vputils::chainUsesScalarValues(const VPValue *Root) {
4444 Worklist.emplace_back (Def, V);
4545 continue ;
4646 }
47- if (isa<VPWidenMemoryRecipe>(U) && vputils::isSingleScalar (Op))
47+
48+ // It is always profitable to widen stores, even if the address or stored
49+ // value are single-scalars: checking that the operand is single-scalar in
50+ // WidenStores is an important leaf condition of chainUsesScalarValues, as
51+ // WidenStores have no users, and checking that the address or stored-val is
52+ // single-scalar allows the chains of uses to be determined to use scalar
53+ // values (and can be narowed in an optimization routine, for example).
54+ if (isa<VPWidenStoreRecipe>(U) && vputils::isSingleScalar (Op))
4855 continue ;
56+
4957 if (auto *VPI = dyn_cast<VPInstruction>(U))
5058 if (VPI->isVectorToScalar () || VPI->isSingleScalar ())
5159 continue ;
You can’t perform that action at this time.
0 commit comments