[03/46] Remove unnecessary update of NUM_SLP_USES
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 31 Jul 2018 14:21:23 +0000 (14:21 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 31 Jul 2018 14:21:23 +0000 (14:21 +0000)
commit6e2dd807c2aaaba8906a36766b9f98dfbeddc27d
tree6760573d95c4d3ddb86bad7346fd830cd6aed104
parentac1359be3a39f4d12342c98c2a2e77bd59a839f4
[03/46] Remove unnecessary update of NUM_SLP_USES

vect_free_slp_tree had:

  gimple *stmt;
  FOR_EACH_VEC_ELT (SLP_TREE_SCALAR_STMTS (node), i, stmt)
    /* After transform some stmts are removed and thus their vinfo is gone.  */
    if (vinfo_for_stmt (stmt))
      {
gcc_assert (STMT_VINFO_NUM_SLP_USES (vinfo_for_stmt (stmt)) > 0);
STMT_VINFO_NUM_SLP_USES (vinfo_for_stmt (stmt))--;
      }

But after transform this update is redundant even for statements that do
exist, so it seems better to skip this loop for the final teardown.

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

gcc/
* tree-vectorizer.h (vect_free_slp_instance): Add a final_p parameter.
* tree-vect-slp.c (vect_free_slp_tree): Likewise.  Don't update
STMT_VINFO_NUM_SLP_USES when it's true.
(vect_free_slp_instance): Add a final_p parameter and pass it to
vect_free_slp_tree.
(vect_build_slp_tree_2): Update call to vect_free_slp_instance.
(vect_analyze_slp_instance): Likewise.
(vect_slp_analyze_operations): Likewise.
(vect_slp_analyze_bb_1): Likewise.
* tree-vectorizer.c (vec_info): Likewise.
* tree-vect-loop.c (vect_transform_loop): Likewise.

From-SVN: r263118
gcc/ChangeLog
gcc/tree-vect-loop.c
gcc/tree-vect-slp.c
gcc/tree-vectorizer.c
gcc/tree-vectorizer.h