[Bug tree-optimization/120396] [12/13/14/15/16 Regression] unprofitable SLP vectorization, leaves scalar parts live

2025-05-23 Thread rguenth at gcc dot gnu.org via Gcc-bugs
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.

[Bug tree-optimization/120396] [12/13/14/15/16 Regression] unprofitable SLP vectorization, leaves scalar parts live

2025-05-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120396

Andrew Pinski  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2025-05-22

[Bug tree-optimization/120396] [12/13/14/15/16 Regression] unprofitable SLP vectorization, leaves scalar parts live

2025-05-22 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120396

Andrew Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |12.5
  Known to work||11.2.0
   Keywords||missed-optimization,
   ||needs-bisection
Summary|unprofitable SLP|[12/13/14/15/16 Regression]
   |vectorization, leaves   |unprofitable SLP
   |scalar parts live   |vectorization, leaves
   ||scalar parts live
  Known to fail||12.2.0

--- Comment #1 from Andrew Pinski  ---
Confirmed.