aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2018-08-01 15:14:56 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-08-01 15:14:56 +0000
commitbeeb6ce8631cd0e23160dbbafd5f43d16a749e02 (patch)
tree96e5a885c8df7a281abe581a0c5cc4f15cca4234 /gcc/tree-vect-loop.c
parent2d4bca81bd7dceb0701e5cd87132d8e3892c22ba (diff)
downloadgcc-beeb6ce8631cd0e23160dbbafd5f43d16a749e02.zip
gcc-beeb6ce8631cd0e23160dbbafd5f43d16a749e02.tar.gz
gcc-beeb6ce8631cd0e23160dbbafd5f43d16a749e02.tar.bz2
[07/11] Use single basic block array in loop_vec_info
_loop_vec_info::_loop_vec_info used get_loop_array to get the order of the blocks when creating stmt_vec_infos, but then used dfs_enumerate_from to get the order of the blocks that the rest of the vectoriser uses. We should be able to use that order for creating stmt_vec_infos too. 2018-08-01 Richard Sandiford <richard.sandiford@arm.com> gcc/ * tree-vect-loop.c (_loop_vec_info::_loop_vec_info): Use the result of dfs_enumerate_from when constructing stmt_vec_infos, instead of additionally calling get_loop_body. From-SVN: r263221
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r--gcc/tree-vect-loop.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index f4ce5b6..92c01a2 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -834,11 +834,18 @@ _loop_vec_info::_loop_vec_info (struct loop *loop_in, vec_info_shared *shared)
scalar_loop (NULL),
orig_loop_info (NULL)
{
- /* Create/Update stmt_info for all stmts in the loop. */
- basic_block *body = get_loop_body (loop);
- for (unsigned int i = 0; i < loop->num_nodes; i++)
+ /* CHECKME: We want to visit all BBs before their successors (except for
+ latch blocks, for which this assertion wouldn't hold). In the simple
+ case of the loop forms we allow, a dfs order of the BBs would the same
+ as reversed postorder traversal, so we are safe. */
+
+ unsigned int nbbs = dfs_enumerate_from (loop->header, 0, bb_in_loop_p,
+ bbs, loop->num_nodes, loop);
+ gcc_assert (nbbs == loop->num_nodes);
+
+ for (unsigned int i = 0; i < nbbs; i++)
{
- basic_block bb = body[i];
+ basic_block bb = bbs[i];
gimple_stmt_iterator si;
for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
@@ -855,16 +862,6 @@ _loop_vec_info::_loop_vec_info (struct loop *loop_in, vec_info_shared *shared)
add_stmt (stmt);
}
}
- free (body);
-
- /* CHECKME: We want to visit all BBs before their successors (except for
- latch blocks, for which this assertion wouldn't hold). In the simple
- case of the loop forms we allow, a dfs order of the BBs would the same
- as reversed postorder traversal, so we are safe. */
-
- unsigned int nbbs = dfs_enumerate_from (loop->header, 0, bb_in_loop_p,
- bbs, loop->num_nodes, loop);
- gcc_assert (nbbs == loop->num_nodes);
}
/* Free all levels of MASKS. */