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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, queued for
stage1.
* 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.
---
gcc/tree-vect-slp.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 10e9ff607ad..c70bc9a7698 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -8979,6 +8979,12 @@ vect_bb_slp_mark_live_stmts (bb_vec_info bb_vinfo,
slp_tree node,
&& 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;
--
2.51.0