]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/116990 - missed control flow check in vect_analyze_loop_form
authorRichard Biener <rguenther@suse.de>
Mon, 7 Oct 2024 09:24:12 +0000 (11:24 +0200)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 7 Oct 2024 11:57:39 +0000 (13:57 +0200)
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.

gcc/tree-vect-loop.cc

index bbadf21efe0f72c7002d8bcd01e6a921006f8209..6933f597b4df419865e56cd04d90d0596a76025b 100644 (file)
@@ -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])))