basic-block.h (PROP_POSTRELOAD): New macro.
authorJan Hubicka <jh@suse.cz>
Fri, 23 Jan 2004 11:02:09 +0000 (12:02 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 23 Jan 2004 11:02:09 +0000 (11:02 +0000)
* basic-block.h (PROP_POSTRELOAD): New macro.
(CLEANUP_LOG_LINKS): New.
* cfgcleanup.c (cleanup_cfg): Only PROP_LOG_LINKS when asked to.
* toplev.c (rest_of_handle_life):  Preserve LOG_LINKS trought cleanup_cfg.

* cselib.c (value_pool): New.
(new_cselib_val): Use pool.
(cselib_init): Initialize value_pool
(cselib_finish): Free pool.

From-SVN: r76405

gcc/ChangeLog
gcc/basic-block.h
gcc/cfgcleanup.c
gcc/cselib.c
gcc/toplev.c

index 3abd95599f3d982f6eea93d9698b7b98fec48405..0e66702d8754c27ed6983cd73c4a67e3071c90df 100644 (file)
@@ -1,3 +1,15 @@
+2004-01-23  Jan Hubicka  <jh@suse.cz>
+
+       * basic-block.h (PROP_POSTRELOAD): New macro.
+       (CLEANUP_LOG_LINKS): New.
+       * cfgcleanup.c (cleanup_cfg): Only PROP_LOG_LINKS when asked to.
+       * toplev.c (rest_of_handle_life):  Preserve LOG_LINKS trought cleanup_cfg.
+
+       * cselib.c (value_pool): New.
+       (new_cselib_val): Use pool.
+       (cselib_init): Initialize value_pool
+       (cselib_finish): Free pool.
+
 2004-01-23  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * config/sparc/sparc.c (scan_record_type): New function.
index e801baf48c7c3f4da20ee1cf5bac274f72fff230..10cc6351bd6826eae05f1f795f354d6664f8328b 100644 (file)
@@ -480,6 +480,10 @@ enum update_life_extent
                                 | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
                                 | PROP_ALLOW_CFG_CHANGES \
                                 | PROP_SCAN_DEAD_STORES)
+#define PROP_POSTRELOAD                (PROP_DEATH_NOTES  \
+                                | PROP_KILL_DEAD_CODE  \
+                                | PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
+                                | PROP_SCAN_DEAD_STORES)
 
 #define CLEANUP_EXPENSIVE      1       /* Do relatively expensive optimizations
                                           except for edge forwarding */
@@ -495,6 +499,7 @@ enum update_life_extent
 #define CLEANUP_NO_INSN_DEL    128     /* Do not try to delete trivially dead
                                           insns.  */
 #define CLEANUP_CFGLAYOUT      256     /* Do cleanup in cfglayout mode.  */
+#define CLEANUP_LOG_LINKS      512     /* Update log links.  */
 extern void life_analysis (rtx, FILE *, int);
 extern int update_life_info (sbitmap, enum update_life_extent, int);
 extern int update_life_info_in_dirty_blocks (enum update_life_extent, int);
index ad44cbb446749ffb1645236c50bbebb7ba74045b..10bffe772939238928e78c7a26ba61506c4fd080 100644 (file)
@@ -1916,7 +1916,8 @@ cleanup_cfg (int mode)
                                                 PROP_DEATH_NOTES
                                                 | PROP_SCAN_DEAD_CODE
                                                 | PROP_KILL_DEAD_CODE
-                                                | PROP_LOG_LINKS))
+                                                | ((mode & CLEANUP_LOG_LINKS)
+                                                   ? PROP_LOG_LINKS : 0)))
            break;
        }
       else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
index 87cc3f4b8b4deb9b557345e10b748bd9b1d61f11..de13ebef93d65764b5c01a05c8407b417b68bea6 100644 (file)
@@ -130,7 +130,7 @@ static cselib_val dummy_val;
    May or may not contain the useless values - the list is compacted
    each time memory is invalidated.  */
 static cselib_val *first_containing_mem = &dummy_val;
-static alloc_pool elt_loc_list_pool, elt_list_pool, cselib_val_pool;
+static alloc_pool elt_loc_list_pool, elt_list_pool, cselib_val_pool, value_pool;
 \f
 
 /* Allocate a struct elt_list and fill in its two elements with the
@@ -694,7 +694,12 @@ new_cselib_val (unsigned int value, enum machine_mode mode)
 #endif
 
   e->value = value;
-  e->u.val_rtx = gen_rtx_VALUE (mode);
+  /* We use custom method to allocate this RTL construct because it accounts
+     about 8% of overall memory usage.  */
+  e->u.val_rtx = pool_alloc (value_pool);
+  memset (e->u.val_rtx, 0, RTX_HDR_SIZE);
+  PUT_CODE (e->u.val_rtx, VALUE);
+  PUT_MODE (e->u.val_rtx, mode);
   CSELIB_VAL_PTR (e->u.val_rtx) = e;
   e->addr_list = 0;
   e->locs = 0;
@@ -1392,6 +1397,8 @@ cselib_init (void)
                                         sizeof (struct elt_loc_list), 10);
   cselib_val_pool = create_alloc_pool ("cselib_val_list", 
                                       sizeof (cselib_val), 10);
+  value_pool = create_alloc_pool ("value", 
+                                 RTX_SIZE (VALUE), 100);
   /* This is only created once.  */
   if (! callmem)
     callmem = gen_rtx_MEM (BLKmode, const0_rtx);
@@ -1420,6 +1427,7 @@ cselib_finish (void)
   free_alloc_pool (elt_list_pool);
   free_alloc_pool (elt_loc_list_pool);
   free_alloc_pool (cselib_val_pool);
+  free_alloc_pool (value_pool);
   clear_table ();
   reg_values_old = reg_values;
   reg_values = 0;
index ea4c56358db48f2170df71b94035a9123e4c3b18..05e753a7628de00702066e5fb545edc5aaaa12d7 100644 (file)
@@ -2812,6 +2812,7 @@ rest_of_handle_life (tree decl, rtx insns)
   life_analysis (insns, rtl_dump_file, PROP_FINAL);
   if (optimize)
     cleanup_cfg ((optimize ? CLEANUP_EXPENSIVE : 0) | CLEANUP_UPDATE_LIFE
+                | CLEANUP_LOG_LINKS
                 | (flag_thread_jumps ? CLEANUP_THREADING : 0));
   timevar_pop (TV_FLOW);
 
@@ -3456,7 +3457,7 @@ rest_of_compilation (tree decl)
 
   if (optimize)
     {
-      life_analysis (insns, rtl_dump_file, PROP_FINAL);
+      life_analysis (insns, rtl_dump_file, PROP_POSTRELOAD);
       cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
                   | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));