The following avoids trying to code-generate live lane extracts for
scalar defs that we have to keep anyway because they are used in
SLP graph leafs as extern inputs.
This resolves the known cases of one of the workarounds in live
code-generation.
* tree-vect-slp.cc (vect_bb_slp_mark_live_stmts): Do not
attempt to live code-generate defs that are kept in scalar
form anyway.
* tree-vect-loop.cc (vectorizable_live_operation): Update
comment.
/* ??? This can happen when the live lane ends up being
rooted in a vector construction code-generated by an
external SLP node (and code-generation for that already
- happened). See gcc.dg/vect/bb-slp-47.c or
- gcc.dg/vect/pr97173.c or gcc.dg/vect/bb-slp-pr115777.c.
+ happened).
Doing this is what would happen if that vector CTOR
were not code-generated yet so it is not too bad.
??? In fact we'd likely want to avoid this situation
&& STMT_VINFO_RELATED_STMT (orig_stmt_info) != stmt_info)
/* Only the pattern root stmt computes the original scalar value. */
continue;
+ if (!PURE_SLP_STMT (orig_stmt_info))
+ /* Iff the stmt is not part of the vector coverage because it or
+ uses of it are used by SLP graph leafs as extern input there is
+ no point in trying to live code-generate from a vector stmt as
+ the scalar stmt will survive anyway. */
+ continue;
bool mark_visited = true;
gimple *orig_stmt = orig_stmt_info->stmt;
ssa_op_iter op_iter;