https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120396
Richard Biener changed:
What|Removed |Added
Priority|P3 |P2
CC||rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener ---
We do try to conservatively cost this, but we hit
/* ??? It can also happen that we end up pulling a def into
a loop where replacing out-of-loop uses would require
a new LC SSA PHI node. Retain the original scalar in
those cases as well. PR98064. */
if (TREE_CODE (new_tree) == SSA_NAME
&& !SSA_NAME_IS_DEFAULT_DEF (new_tree)
&& (gimple_bb (use_stmt)->loop_father
!= gimple_bb (vec_stmt)->loop_father)
&& !flow_loop_nested_p (gimple_bb (vec_stmt)->loop_father,
gimple_bb (use_stmt)->loop_father))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
"Using original scalar computation for "
"live lane because there is an out-of-loop "
"definition for it\n");
continue;
during transform. Given we do not pre-compute the schedule of vector stmts
on the scalar code we cannot do these verifications during analysis/costing.
That's a long-standing issue. I bet bisection will hit the PR98064 fix.