aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop-invariant.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-04-04 07:35:34 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-04-04 07:35:34 +0000
commit6541e97d4da7df25f948e544fc09271a91aee8f8 (patch)
tree0204ba9afddd95196fbf6013eee38328ccb5850f /gcc/loop-invariant.c
parent325d3f4642eb72812b4dbbd15968228d27f135a1 (diff)
downloadgcc-6541e97d4da7df25f948e544fc09271a91aee8f8.zip
gcc-6541e97d4da7df25f948e544fc09271a91aee8f8.tar.gz
gcc-6541e97d4da7df25f948e544fc09271a91aee8f8.tar.bz2
DF usage in loop-invariant.c (PR46590)
- df_live is already present at -O2, so we only need to add it and mark all blocks dirty for -O - df_process_deferred_rescans should be enough to force a rescan of blocks affected by moving invariants, but calling it in find_defs means that we don't do any rescans for the final loop 2019-04-04 Richard Sandiford <richard.sandiford@arm.com> gcc/ PR rtl-optimization/46590 * loop-invariant.c (find_defs): Move df_remove_problem and df_process_deferred_rescans to move_invariants. Move df_live_add_problem and df_live_set_all_dirty calls to move_invariants. (move_invariants): Likewise. (move_loop_invariants): Likewise, making the df_live calls conditional on -O. Remove the problem again if we added it locally. From-SVN: r270142
Diffstat (limited to 'gcc/loop-invariant.c')
-rw-r--r--gcc/loop-invariant.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c
index 3e82f1e..b880ead 100644
--- a/gcc/loop-invariant.c
+++ b/gcc/loop-invariant.c
@@ -681,11 +681,7 @@ find_defs (struct loop *loop)
loop->num);
}
- df_remove_problem (df_chain);
- df_process_deferred_rescans ();
df_chain_add_problem (DF_UD_CHAIN);
- df_live_add_problem ();
- df_live_set_all_dirty ();
df_set_flags (DF_RD_PRUNE_DEAD_DEFS);
df_analyze_loop (loop);
check_invariant_table_size ();
@@ -1891,6 +1887,10 @@ move_invariants (struct loop *loop)
GENERAL_REGS, NO_REGS, GENERAL_REGS);
}
}
+ /* Remove the DF_UD_CHAIN problem added in find_defs before rescanning,
+ to save a bit of compile time. */
+ df_remove_problem (df_chain);
+ df_process_deferred_rescans ();
}
/* Initializes invariant motion data. */
@@ -2254,6 +2254,14 @@ move_loop_invariants (void)
{
struct loop *loop;
+ if (optimize == 1)
+ df_live_add_problem ();
+ /* ??? This is a hack. We should only need to call df_live_set_all_dirty
+ for optimize == 1, but can_move_invariant_reg relies on DF_INSN_LUID
+ being up-to-date. That isn't always true (even after df_analyze)
+ because df_process_deferred_rescans doesn't necessarily cause
+ blocks to be rescanned. */
+ df_live_set_all_dirty ();
if (flag_ira_loop_pressure)
{
df_analyze ();
@@ -2286,5 +2294,8 @@ move_loop_invariants (void)
invariant_table = NULL;
invariant_table_size = 0;
+ if (optimize == 1)
+ df_remove_problem (df_live);
+
checking_verify_flow_info ();
}