From 7184d2257a0d927e6e3736ba0a169d557e673ad5 Mon Sep 17 00:00:00 2001 From: Kewen Lin Date: Thu, 12 Oct 2023 00:04:57 -0500 Subject: [PATCH] vect: Simplify costing on vectorizable_scan_store This patch is to simplify the costing on the case vectorizable_scan_store without calling function vect_model_store_cost any more. I considered if moving the costing into function vectorizable_scan_store is a good idea, for doing that, we have to pass several variables down which are only used for costing, and for now we just want to keep the costing as the previous, haven't tried to make this costing consistent with what the transforming does, so I think we can leave it for now. gcc/ChangeLog: * tree-vect-stmts.cc (vectorizable_store): Adjust costing on vectorizable_scan_store without calling vect_model_store_cost any more. --- gcc/tree-vect-stmts.cc | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 3f908242fee4..048c14d291c4 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -8432,11 +8432,23 @@ vectorizable_store (vec_info *vinfo, else if (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) >= 3) { gcc_assert (memory_access_type == VMAT_CONTIGUOUS); + gcc_assert (!slp); if (costing_p) { - vect_model_store_cost (vinfo, stmt_info, ncopies, memory_access_type, - alignment_support_scheme, misalignment, - vls_type, slp_node, cost_vec); + 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); + vect_get_store_cost (vinfo, stmt_info, ncopies, + alignment_support_scheme, misalignment, + &inside_cost, cost_vec); + + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, vect_location, + "vect_model_store_cost: inside_cost = %d, " + "prologue_cost = %d .\n", + inside_cost, prologue_cost); + return true; } return vectorizable_scan_store (vinfo, stmt_info, gsi, vec_stmt, ncopies); -- 2.47.2