]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
vect: Simplify costing on vectorizable_scan_store
authorKewen Lin <linkw@linux.ibm.com>
Thu, 12 Oct 2023 05:04:57 +0000 (00:04 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 12 Oct 2023 05:04:57 +0000 (00:04 -0500)
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

index 3f908242fee4aca2eadb957e3eae991e0531749d..048c14d291c4a65cc37bf278947ab2110dcdc0f2 100644 (file)
@@ -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);