https://gcc.gnu.org/g:a32e1ec926561ce98c0658d62f66b42dc2a9d8b8

commit r17-4562-ga32e1ec926561ce98c0658d62f66b42dc2a9d8b8
Author: Richard Biener <[email protected]>
Date:   Tue Sep 22 13:40:14 2026 +0200

    Enable live lane extraction costing for loop vect
    
    This also makes sure to consistently use vect_body for BB vectorization.
    
            * tree-vect-loop.cc (vectorizable_live_operation): Cost
            the lane extract in vect_body for BB vectorization and
            in vect_epilog for loop vectorization.

Diff:
---
 gcc/tree-vect-loop.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 5169b60025e5..e724a8f6086e 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -10324,10 +10324,8 @@ vectorizable_live_operation (vec_info *vinfo, 
stmt_vec_info stmt_info,
                }
            }
        }
-      /* ???  Enable for loop costing as well.  */
-      if (!loop_vinfo)
-       record_stmt_cost (cost_vec, 1, vec_to_scalar, slp_node,
-                         0, vect_epilogue);
+      record_stmt_cost (cost_vec, 1, vec_to_scalar, slp_node,
+                       0, loop_vinfo ? vect_epilogue : vect_body);
       SLP_TREE_LIVE_LANES (slp_node).safe_push (slp_index);
       return true;
     }

Reply via email to