diff options
author | Richard Biener <rguenther@suse.de> | 2019-10-14 14:03:35 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-10-14 14:03:35 +0000 |
commit | fc2d730302da5cdf340a5100882337a807097f47 (patch) | |
tree | 65f3e0e6394e85f54af41bfd50cfafb1c0fc8c59 /gcc/dse.c | |
parent | d2317d50ae2402e5335f2ed807a166359565566b (diff) | |
download | gcc-fc2d730302da5cdf340a5100882337a807097f47.zip gcc-fc2d730302da5cdf340a5100882337a807097f47.tar.gz gcc-fc2d730302da5cdf340a5100882337a807097f47.tar.bz2 |
re PR middle-end/92046 (Command line options (that are per-functions) are affecting --params which are global.)
2019-10-14 Richard Biener <rguenther@suse.de>
PR middle-end/92046
* dse.c (scan_insn): Use param max_active_local_stores.
(dse_step1): Get PARAM_MAX_DSE_ACTIVE_LOCAL_STORES and adjust
based on optimization level.
* loop-invariant.c (move_loop_invariants): Adjust
LOOP_INVARIANT_MAX_BBS_IN_LOOP based on optimization level.
* opts.c (default_options_optimization): Do not adjust
PARAM_MAX_DSE_ACTIVE_LOCAL_STORES and
LOOP_INVARIANT_MAX_BBS_IN_LOOP here.
From-SVN: r276963
Diffstat (limited to 'gcc/dse.c')
-rw-r--r-- | gcc/dse.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -2401,7 +2401,7 @@ copy_fixed_regs (const_bitmap in) non-register target. */ static void -scan_insn (bb_info_t bb_info, rtx_insn *insn) +scan_insn (bb_info_t bb_info, rtx_insn *insn, int max_active_local_stores) { rtx body; insn_info_type *insn_info = insn_info_type_pool.allocate (); @@ -2523,8 +2523,7 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn) fprintf (dump_file, "handling memset as BLKmode store\n"); if (mems_found == 1) { - if (active_local_stores_len++ - >= PARAM_VALUE (PARAM_MAX_DSE_ACTIVE_LOCAL_STORES)) + if (active_local_stores_len++ >= max_active_local_stores) { active_local_stores_len = 1; active_local_stores = NULL; @@ -2584,8 +2583,7 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn) it as cannot delete. This simplifies the processing later. */ if (mems_found == 1) { - if (active_local_stores_len++ - >= PARAM_VALUE (PARAM_MAX_DSE_ACTIVE_LOCAL_STORES)) + if (active_local_stores_len++ >= max_active_local_stores) { active_local_stores_len = 1; active_local_stores = NULL; @@ -2657,6 +2655,12 @@ dse_step1 (void) bitmap_set_bit (all_blocks, ENTRY_BLOCK); bitmap_set_bit (all_blocks, EXIT_BLOCK); + /* For -O1 reduce the maximum number of active local stores for RTL DSE + since this can consume huge amounts of memory (PR89115). */ + int max_active_local_stores = PARAM_VALUE (PARAM_MAX_DSE_ACTIVE_LOCAL_STORES); + if (optimize < 2) + max_active_local_stores /= 10; + FOR_ALL_BB_FN (bb, cfun) { insn_info_t ptr; @@ -2684,7 +2688,7 @@ dse_step1 (void) FOR_BB_INSNS (bb, insn) { if (INSN_P (insn)) - scan_insn (bb_info, insn); + scan_insn (bb_info, insn, max_active_local_stores); cselib_process_insn (insn); if (INSN_P (insn)) df_simulate_one_insn_forwards (bb, insn, regs_live); |