The following works around the DSE part of PR89115, consuming huge
amounts of memory and compile-time.  To make "bad" testcases behave
more reasonably the following cuts down --param 
max-dse-active-local-stores from 5000 to 500, reducing compile-time
by a factor of 2.5 and memory use by a factor of 5.3.

I'm making both existing scalings relative to the default
(but keep the actual scaled down value).

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Richard.

2019-01-30  Richard Biener  <rguent...@suse.de>

        PR rtl-optimization/89115
        * opts.c (default_options_optimization): Reduce
        PARAM_MAX_DSE_ACTIVE_LOCAL_STORES by a factor of 10 at -O1.
        Make PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP reduction relative
        to the default.

Index: gcc/opts.c
===================================================================
--- gcc/opts.c  (revision 268383)
+++ gcc/opts.c  (working copy)
@@ -670,7 +670,16 @@ default_options_optimization (struct gcc
   /* 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) : 1000,
+     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.  */

Reply via email to