Commit fc2d7303 by Richard Biener Committed by Richard Biener

re PR middle-end/92046 (Command line options (that are per-functions) are…

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
parent d2317d50
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.
2019-10-14 Wilco Dijkstra <wdijkstr@arm.com>
* config/arm/arm.c (arm_legitimize_address): Remove Thumb-2 bailout.
......
......@@ -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);
......
......@@ -2276,9 +2276,13 @@ move_loop_invariants (void)
FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
{
curr_loop = loop;
/* move_single_loop_invariants for very large loops
is time consuming and might need a lot of memory. */
if (loop->num_nodes <= (unsigned) LOOP_INVARIANT_MAX_BBS_IN_LOOP)
/* move_single_loop_invariants for very large loops is time consuming
and might need a lot of memory. For -O1 only do loop invariant
motion for very small loops. */
unsigned max_bbs = LOOP_INVARIANT_MAX_BBS_IN_LOOP;
if (optimize < 2)
max_bbs /= 10;
if (loop->num_nodes <= max_bbs)
move_single_loop_invariants (loop);
}
......
......@@ -671,21 +671,6 @@ default_options_optimization (struct gcc_options *opts,
opt2 ? 100 : default_param_value (PARAM_MAX_FIELDS_FOR_FIELD_SENSITIVE),
opts->x_param_values, opts_set->x_param_values);
/* For -O1 only do loop invariant motion for very small loops. */
maybe_set_param_value
(PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP,
opt2 ? default_param_value (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP)
: default_param_value (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP) / 10,
opts->x_param_values, opts_set->x_param_values);
/* For -O1 reduce the maximum number of active local stores for RTL DSE
since this can consume huge amounts of memory (PR89115). */
maybe_set_param_value
(PARAM_MAX_DSE_ACTIVE_LOCAL_STORES,
opt2 ? default_param_value (PARAM_MAX_DSE_ACTIVE_LOCAL_STORES)
: default_param_value (PARAM_MAX_DSE_ACTIVE_LOCAL_STORES) / 10,
opts->x_param_values, opts_set->x_param_values);
/* At -Ofast, allow store motion to introduce potential race conditions. */
maybe_set_param_value
(PARAM_ALLOW_STORE_DATA_RACES,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment