diff options
author | Richard Biener <rguenther@suse.de> | 2024-09-23 11:05:37 +0200 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2024-09-23 12:50:59 +0200 |
commit | e97c75d668bacd8a2e901b819e00156f6e9f4c6c (patch) | |
tree | 8914c8db42272fd9eb93ed029cb6cd40e1bd24ef /gcc | |
parent | 09892448ebd8c396a26b2c09ba71f1e5a8dc42d7 (diff) | |
download | gcc-e97c75d668bacd8a2e901b819e00156f6e9f4c6c.zip gcc-e97c75d668bacd8a2e901b819e00156f6e9f4c6c.tar.gz gcc-e97c75d668bacd8a2e901b819e00156f6e9f4c6c.tar.bz2 |
tree-optimization/116796 - virtual LC SSA broken after unrolling
When the unroller unloops loops it tracks whether it changes any
nesting relationship of remaining loops but when scanning a loops
preheader it fails to pass down the LC-SSA-invalidated bitmap, losing
the fact that an unrolled formerly inner loop can now be placed on
an exit of its outer loop. The following fixes that.
PR tree-optimization/116796
* cfgloopmanip.cc (fix_loop_placements): Get LC-SSA-invalidated
bitmap and pass it on.
(remove_path): Pass LC-SSA-invalidated to fix_loop_placements.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cfgloopmanip.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cfgloopmanip.cc b/gcc/cfgloopmanip.cc index 3707db2..d37d351 100644 --- a/gcc/cfgloopmanip.cc +++ b/gcc/cfgloopmanip.cc @@ -39,7 +39,7 @@ static void loop_redirect_edge (edge, basic_block); static void remove_bbs (basic_block *, int); static bool rpe_enum_p (const_basic_block, const void *); static int find_path (edge, basic_block **); -static void fix_loop_placements (class loop *, bool *); +static void fix_loop_placements (class loop *, bool *, bitmap); static bool fix_bb_placement (basic_block); static void fix_bb_placements (basic_block, bool *, bitmap); @@ -415,7 +415,8 @@ remove_path (edge e, bool *irred_invalidated, /* Fix placements of basic blocks inside loops and the placement of loops in the loop tree. */ fix_bb_placements (from, irred_invalidated, loop_closed_ssa_invalidated); - fix_loop_placements (from->loop_father, irred_invalidated); + fix_loop_placements (from->loop_father, irred_invalidated, + loop_closed_ssa_invalidated); if (local_irred_invalidated && loops_state_satisfies_p (LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)) @@ -1048,7 +1049,8 @@ unloop (class loop *loop, bool *irred_invalidated, invalidate the information about irreducible regions. */ static void -fix_loop_placements (class loop *loop, bool *irred_invalidated) +fix_loop_placements (class loop *loop, bool *irred_invalidated, + bitmap loop_closed_ssa_invalidated) { class loop *outer; @@ -1064,7 +1066,7 @@ fix_loop_placements (class loop *loop, bool *irred_invalidated) to the loop. So call fix_bb_placements to fix up the placement of the preheader and (possibly) of its predecessors. */ fix_bb_placements (loop_preheader_edge (loop)->src, - irred_invalidated, NULL); + irred_invalidated, loop_closed_ssa_invalidated); loop = outer; } } |