The following fixes another few missed cases to pass a SLP node
instead of a stmt_info.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

        * tree-vect-loop.cc (vectorizable_reduction): Pass the
        appropriate SLP node for costing of single-def-use-cycle
        operations.
        (vectorizable_live_operation): Pass the SLP node to the
        costing hook.
        * tree-vect-stmts.cc (vectorizable_bswap): Likewise.
        (vectorizable_store): Likewise.
---
 gcc/tree-vect-loop.cc  | 5 +++--
 gcc/tree-vect-stmts.cc | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 9961c8c55e2..17be3b82901 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7875,7 +7875,8 @@ vectorizable_reduction (loop_vec_info loop_vinfo,
      vect_transform_reduction for non-lane-reducing operation.  Otherwise
      this is costed by the separate vectorizable_* routines.  */
   if (single_defuse_cycle)
-    record_stmt_cost (cost_vec, ncopies, vector_stmt, stmt_info, 0, vect_body);
+    record_stmt_cost (cost_vec, ncopies, vector_stmt,
+                     slp_for_stmt_info, 0, vect_body);
 
   if (dump_enabled_p ()
       && reduction_type == FOLD_LEFT_REDUCTION)
@@ -10361,7 +10362,7 @@ 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, stmt_info, NULL_TREE,
+       record_stmt_cost (cost_vec, 1, vec_to_scalar, slp_node,
                          0, vect_epilogue);
       return true;
     }
diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index fabdb2949e3..1ca3de7df5a 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -3114,10 +3114,10 @@ vectorizable_bswap (vec_info *vinfo,
       SLP_TREE_TYPE (slp_node) = call_vec_info_type;
       DUMP_VECT_SCOPE ("vectorizable_bswap");
       record_stmt_cost (cost_vec,
-                       1, vector_stmt, stmt_info, 0, vect_prologue);
+                       1, vector_stmt, slp_node, 0, vect_prologue);
       record_stmt_cost (cost_vec,
                        SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node),
-                       vec_perm, stmt_info, 0, vect_body);
+                       vec_perm, slp_node, 0, vect_body);
       return true;
     }
 
@@ -7947,7 +7947,7 @@ vectorizable_store (vec_info *vinfo,
          unsigned int inside_cost = 0, prologue_cost = 0;
          if (vls_type == VLS_STORE_INVARIANT)
            prologue_cost += record_stmt_cost (cost_vec, 1, scalar_to_vec,
-                                              stmt_info, 0, vect_prologue);
+                                              slp_node, 0, vect_prologue);
          vect_get_store_cost (vinfo, stmt_info, slp_node, 1,
                               alignment_support_scheme, misalignment,
                               &inside_cost, cost_vec);
-- 
2.43.0

Reply via email to