OSDN Git Service

Partial fox for PR opt/10776 II
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Jan 2004 09:44:16 +0000 (09:44 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 12 Jan 2004 09:44:16 +0000 (09:44 +0000)
* 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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75710 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 1f23cbd..d7a7971 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 fde9b84..0a5c3c8 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 8cb325d..99c4bec 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 9099090..0b2b366 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 a5b3099..3f0d15b 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