diff options
author | Richard Biener <rguenther@suse.de> | 2024-01-15 10:03:59 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2024-01-15 12:27:11 +0100 |
commit | afac1bd33657a5054f5e6ea6746c25bbb70b82f2 (patch) | |
tree | f0bb926849ad2b87cd05c3c7c2989a886afa1bb6 | |
parent | e037a0fa040ee1a3500c8523f3ffa713069ac283 (diff) | |
download | gcc-afac1bd33657a5054f5e6ea6746c25bbb70b82f2.zip gcc-afac1bd33657a5054f5e6ea6746c25bbb70b82f2.tar.gz gcc-afac1bd33657a5054f5e6ea6746c25bbb70b82f2.tar.bz2 |
tree-optimization/113385 - wrong loop father with early exit vectorization
The following avoids splitting an edge before redirecting it. This
allows the loop father of the new block to be correct in the first
place.
PR tree-optimization/113385
* tree-vect-loop-manip.cc (slpeel_tree_duplicate_loop_to_edge_cfg):
First redirect, then split the exit edge.
-rw-r--r-- | gcc/tree-vect-loop-manip.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/tree-vect-loop-manip.cc b/gcc/tree-vect-loop-manip.cc index 1d6e5e0..c7e73f6 100644 --- a/gcc/tree-vect-loop-manip.cc +++ b/gcc/tree-vect-loop-manip.cc @@ -1613,11 +1613,11 @@ slpeel_tree_duplicate_loop_to_edge_cfg (class loop *loop, edge loop_exit, { if (!alt_loop_exit_block) { - alt_loop_exit_block = split_edge (exit); edge res = redirect_edge_and_branch ( - single_succ_edge (alt_loop_exit_block), + exit, new_preheader); flush_pending_stmts (res); + alt_loop_exit_block = split_edge (res); continue; } dest = alt_loop_exit_block; |