diff options
author | Richard Biener <rguenther@suse.de> | 2024-10-07 11:24:12 +0200 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2024-10-07 13:57:39 +0200 |
commit | b0b71618157ddac52266909978f331406f98f3a2 (patch) | |
tree | a7051f134d4ffe5a353ad9e0a0fb41801e1c78f9 | |
parent | 9b86efd5210101954bd187c3aa8bb909610a5746 (diff) | |
download | gcc-b0b71618157ddac52266909978f331406f98f3a2.zip gcc-b0b71618157ddac52266909978f331406f98f3a2.tar.gz gcc-b0b71618157ddac52266909978f331406f98f3a2.tar.bz2 |
tree-optimization/116990 - missed control flow check in vect_analyze_loop_form
The following fixes checking for unsupported control flow in
vectorization to also cover the outer loop body.
PR tree-optimization/116990
* tree-vect-loop.cc (vect_analyze_loop_form): Check the current
loop body for control flow.
-rw-r--r-- | gcc/tree-vect-loop.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index bbadf21..6933f59 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -1767,9 +1767,8 @@ vect_analyze_loop_form (class loop *loop, gimple *loop_vectorized_call, exit_e->src->index, exit_e->dest->index, exit_e->aux); /* Check if we have any control flow that doesn't leave the loop. */ - class loop *v_loop = loop->inner ? loop->inner : loop; - basic_block *bbs = get_loop_body (v_loop); - for (unsigned i = 0; i < v_loop->num_nodes; i++) + basic_block *bbs = get_loop_body (loop); + for (unsigned i = 0; i < loop->num_nodes; i++) if (EDGE_COUNT (bbs[i]->succs) != 1 && (EDGE_COUNT (bbs[i]->succs) != 2 || !loop_exits_from_bb_p (bbs[i]->loop_father, bbs[i]))) |