aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2025-08-19 12:52:39 +0200
committerRichard Biener <rguenth@gcc.gnu.org>2025-08-19 14:40:50 +0200
commit3bc63918cec91b0e1cd40ed7d4990a93f254678e (patch)
tree4a8df147235f29a7fe18ddfe1f66e5a1aa4edd3b /gcc
parent05284f73cff1685e2513b415e8da644193acf8cd (diff)
downloadgcc-3bc63918cec91b0e1cd40ed7d4990a93f254678e.zip
gcc-3bc63918cec91b0e1cd40ed7d4990a93f254678e.tar.gz
gcc-3bc63918cec91b0e1cd40ed7d4990a93f254678e.tar.bz2
A few missing SLP node passings to vector costing
The following fixes another few missed cases to pass a SLP node instead of a stmt_info. * 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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-loop.cc5
-rw-r--r--gcc/tree-vect-stmts.cc6
2 files changed, 6 insertions, 5 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
index 006fe98..0df0d77 100644
--- a/gcc/tree-vect-loop.cc
+++ b/gcc/tree-vect-loop.cc
@@ -7892,7 +7892,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)
@@ -10378,7 +10379,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 675c6e2..33f1dfd 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -3107,10 +3107,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;
}
@@ -7940,7 +7940,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);