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 @@ -43,8 +43,16 @@ bool vputils::chainUsesScalarValues(const VPValue *Root) {
4343 Worklist.emplace_back (Def, V);
4444 continue ;
4545 }
46- if (isa<VPWidenMemoryRecipe>(U) && vputils::isSingleScalar (Op))
46+
47+ // It is always profitable to widen stores, even if the address or stored
48+ // value are single-scalars: checking that the operand is single-scalar in
49+ // WidenStores is an important leaf condition of chainUsesScalarValues, as
50+ // WidenStores have no users, and checking that the address or stored-val is
51+ // single-scalar allows the chains of uses to be determined to use scalar
52+ // values (and can be narowed in an optimization routine, for example).
53+ if (isa<VPWidenStoreRecipe>(U) && vputils::isSingleScalar (Op))
4754 continue ;
55+
4856 if (auto *VPI = dyn_cast<VPInstruction>(U))
4957 if (VPI->isVectorToScalar () || VPI->isSingleScalar ())
5058 continue ;
You can’t perform that action at this time.
0 commit comments