tree-optimization/104582 - make SLP node available in vector cost hook
authorRichard Biener <rguenther@suse.de>
Fri, 18 Feb 2022 10:50:44 +0000 (11:50 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 22 Feb 2022 06:48:38 +0000 (07:48 +0100)
commitf24dfc76177b3994434c8beb287cde1a9976b5ce
tree198480fb098a52bf230d5e9e5b208fef8a58b2a7
parent61fc5e098e76c9809f35f449a70c9c8d74773d9d
tree-optimization/104582 - make SLP node available in vector cost hook

This adjusts the vectorizer costing API to allow passing down the
SLP node the vector stmt is created from.

2022-02-18  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104582
* tree-vectorizer.h (stmt_info_for_cost::node): New field.
(vector_costs::add_stmt_cost): Add SLP node parameter.
(dump_stmt_cost): Likewise.
(add_stmt_cost): Likewise, new overload and adjust.
(add_stmt_costs): Adjust.
(record_stmt_cost): New overload.
* tree-vectorizer.cc (dump_stmt_cost): Dump the SLP node.
(vector_costs::add_stmt_cost): Adjust.
* tree-vect-loop.cc (vect_estimate_min_profitable_iters):
Adjust.
* tree-vect-slp.cc (vect_prologue_cost_for_slp): Record
the SLP node for costing.
(vectorizable_slp_permutation): Likewise.
* tree-vect-stmts.cc (record_stmt_cost): Adjust and add
new overloads.
* config/i386/i386.cc (ix86_vector_costs::add_stmt_cost):
Adjust.
* config/aarch64/aarch64.cc (aarch64_vector_costs::add_stmt_cost):
Adjust.
* config/rs6000/rs6000.cc (rs6000_vector_costs::add_stmt_cost):
Adjust.
(rs6000_cost_data::adjust_vect_cost_per_loop): Likewise.
gcc/config/aarch64/aarch64.cc
gcc/config/i386/i386.cc
gcc/config/rs6000/rs6000.cc
gcc/tree-vect-loop.cc
gcc/tree-vect-slp.cc
gcc/tree-vect-stmts.cc
gcc/tree-vectorizer.cc
gcc/tree-vectorizer.h