+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.
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 ();
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;
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;
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;
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);
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);
}
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,