[12/46] Make vect_finish_stmt_generation return a stmt_vec_info
commit585ed623c01fb61f97f6c05b6fb77104e092a4ac
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 14:22:05 +0000 (31 14:22 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 31 Jul 2018 14:22:05 +0000 (31 14:22 +0000)
tree61ce73a63a79b56f77a39ccb07e013a49b8732aa
parentbfa5bad688a5a745199a3d847deb0c68da637347
[12/46] Make vect_finish_stmt_generation return a stmt_vec_info

This patch makes vect_finish_replace_stmt and vect_finish_stmt_generation
return the stmt_vec_info for the vectorised statement, so that the caller
doesn't need a separate vinfo_for_stmt to get at it.

This involved changing the structure of the statement-generating loops
so that they use narrow scopes for the vectorised gimple statements
and use the existing (wider) scopes for the associated stmt_vec_infos.
This helps with gimple stmt->stmt_vec_info changes further down the line.

The way we do this generation is another area ripe for clean-up,
but that's too much of a rabbit-hole for this series.

2018-07-31  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* tree-vectorizer.h (vect_finish_replace_stmt): Return a stmt_vec_info
(vect_finish_stmt_generation): Likewise.
* tree-vect-stmts.c (vect_finish_stmt_generation_1): Likewise.
(vect_finish_replace_stmt, vect_finish_stmt_generation): Likewise.
(vect_build_gather_load_calls): Use the return value of the above
functions instead of a separate call to vinfo_for_stmt.  Use narrow
scopes for the input gimple stmt and wider scopes for the associated
stmt_vec_info.  Use vec_info::lookup_def when setting these
stmt_vec_infos from an SSA_NAME definition.
(vectorizable_bswap, vectorizable_call, vectorizable_simd_clone_call)
(vect_create_vectorized_demotion_stmts, vectorizable_conversion)
(vectorizable_assignment, vectorizable_shift, vectorizable_operation)
(vectorizable_store, vectorizable_load, vectorizable_condition)
(vectorizable_comparison): Likewise.
* tree-vect-loop.c (vectorize_fold_left_reduction): Likewise.
(vectorizable_reduction): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263127 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c
gcc/tree-vectorizer.h