Partial fox for PR opt/10776 II
authorJan Hubicka <jh@suse.cz>
Mon, 12 Jan 2004 09:44:16 +0000 (10:44 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 12 Jan 2004 09:44:16 +0000 (09:44 +0000)
Partial fox for PR opt/10776 II
* cselib.c: Include params.h
(cselib_invalidate_mem):  Limit amount of nonconflicting memory
locations.
* params.def (PARAM_MAX_CSELIB_MEMORY_LOCATIONS): New.
* Makefile.in (cselib.o): Depend on params.h

From-SVN: r75710

gcc/ChangeLog
gcc/Makefile.in
gcc/cselib.c
gcc/doc/invoke.texi
gcc/params.def

index 1f23cbdf868be1ad53a88b5807ae67ff280ab446..d7a797173d261a3a2cf9b125191414bc87bcb2d5 100644 (file)
@@ -1,3 +1,12 @@
+2004-01-12  Jan Hubicka  <jh@suse.cz>
+
+       Partial fox for PR opt/10776 II
+       * cselib.c: Include params.h
+       (cselib_invalidate_mem):  Limit amount of nonconflicting memory
+       locations.
+       * params.def (PARAM_MAX_CSELIB_MEMORY_LOCATIONS): New.
+       * Makefile.in (cselib.o): Depend on params.h
+
 2004-01-12  Richard Sandiford  <rsandifo@redhat.com>
 
        * combine.c (combine_simplify_rtx): Don't pass VOIDmode to
index fde9b844cbb87e306fafbd32f9388f0d87e55a54..0a5c3c8227a5eb3625262bc7c2e1e5dd0ae84dc9 100644 (file)
@@ -1643,7 +1643,7 @@ coverage.o : coverage.c gcov-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
    gt-coverage.h $(HASHTAB_H)
 cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
    hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
-   output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h
+   output.h function.h cselib.h $(GGC_H) $(TM_P_H) gt-cselib.h $(PARAMS_H)
 cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
    hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
    output.h function.h $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \
index 8cb325d61a5ece14ba4879e4520edd5346736258..99c4bec1c412e3022f57339cdad04f9a17661efa 100644 (file)
@@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "ggc.h"
 #include "hashtab.h"
 #include "cselib.h"
+#include "params.h"
 
 static int entry_and_rtx_equal_p (const void *, const void *);
 static hashval_t get_value_hash (const void *);
@@ -1114,6 +1115,7 @@ static void
 cselib_invalidate_mem (rtx mem_rtx)
 {
   cselib_val **vp, *v, *next;
+  int num_mems = 0;
 
   vp = &first_containing_mem;
   for (v = *vp; v != &dummy_val; v = next)
@@ -1135,9 +1137,11 @@ cselib_invalidate_mem (rtx mem_rtx)
              p = &(*p)->next;
              continue;
            }
-         if (! cselib_mem_conflict_p (mem_rtx, x))
+         if (num_mems < PARAM_VALUE (PARAM_MAX_CSELIB_MEMORY_LOCATIONS)
+             && ! cselib_mem_conflict_p (mem_rtx, x))
            {
              has_mem = true;
+             num_mems++;
              p = &(*p)->next;
              continue;
            }
index 909909002b1f78f831d7edf474ac1aef73d96700..0b2b3664dd045d5e963713b7997c919dedafabe5 100644 (file)
@@ -4859,6 +4859,11 @@ register.  Increasing values mean more aggressive optimization, making the
 compile time increase with probably slightly better performance.  The default
 value is 100.
 
+@item max-cselib-memory-location
+The maximum number of memory locations cselib should take into acount.
+Increasing values mean more aggressive optimization, making the compile time
+increase with probably slightly better performance.  The default value is 500.
+
 @item reorder-blocks-duplicate
 @itemx reorder-blocks-duplicate-feedback
 
index a5b3099ca0e0b148799ce27c70d650fbe62b8b93..3f0d15b185408ce9e26435f50307006ee97c1081 100644 (file)
@@ -238,6 +238,11 @@ DEFPARAM(PARAM_MAX_CSE_PATH_LENGTH,
         "The maximum length of path considered in cse",
         10)
 
+DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS,
+        "max-cselib-memory-locations",
+        "The maximum memory locations recorded by cselib",
+        500)
+
 #ifdef ENABLE_GC_ALWAYS_COLLECT
 # define GGC_MIN_EXPAND_DEFAULT 0
 # define GGC_MIN_HEAPSIZE_DEFAULT 0