This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[rtlopt] Various
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 8 Dec 2002 20:00:44 +0100
- Subject: [rtlopt] Various
Hello,
here are some minor changes I made during my work on flow.c cleanup.
Zdenek
Changelog:
* basic-block.h (PROP_FINAL): Do not include PROP_LOG_LINKS.
* cfgcleanup.c (cleanup_cfg): Do not update log links.
* ra.c (reg_alloc): Do not create log links.
* loop-init.c (loop_optimizer_init): Free rc_order and dfs_order here
(loop_optimizer_finalize): ... instead of here.
* profile.c (branch_prob): Always build loop datastructure.
* toplev.c (rest_of_compilation): Build log links just before
combine and regmove passes.
Index: basic-block.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/basic-block.h,v
retrieving revision 1.158.2.3
diff -c -3 -p -r1.158.2.3 basic-block.h
*** basic-block.h 8 Nov 2002 20:47:09 -0000 1.158.2.3
--- basic-block.h 8 Dec 2002 18:42:18 -0000
*************** enum update_life_extent
*** 478,484 ****
#define PROP_AUTOINC 64 /* Create autoinc mem references. */
#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */
#define PROP_SCAN_DEAD_STORES 256 /* Scan for dead code. */
! #define PROP_FINAL (PROP_DEATH_NOTES | PROP_LOG_LINKS \
| PROP_REG_INFO | PROP_KILL_DEAD_CODE \
| PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
| PROP_ALLOW_CFG_CHANGES \
--- 478,484 ----
#define PROP_AUTOINC 64 /* Create autoinc mem references. */
#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */
#define PROP_SCAN_DEAD_STORES 256 /* Scan for dead code. */
! #define PROP_FINAL (PROP_DEATH_NOTES \
| PROP_REG_INFO | PROP_KILL_DEAD_CODE \
| PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
| PROP_ALLOW_CFG_CHANGES \
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.63.2.4
diff -c -3 -p -r1.63.2.4 cfgcleanup.c
*** cfgcleanup.c 8 Dec 2002 14:36:12 -0000 1.63.2.4
--- cfgcleanup.c 8 Dec 2002 18:42:18 -0000
*************** cleanup_cfg (mode)
*** 1821,1828 ****
if (!update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
PROP_DEATH_NOTES
| PROP_SCAN_DEAD_CODE
! | PROP_KILL_DEAD_CODE
! | PROP_LOG_LINKS))
break;
}
else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
--- 1821,1827 ----
if (!update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
PROP_DEATH_NOTES
| PROP_SCAN_DEAD_CODE
! | PROP_KILL_DEAD_CODE))
break;
}
else if (!(mode & (CLEANUP_NO_INSN_DEL | CLEANUP_PRE_SIBCALL))
Index: loop-init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/loop-init.c,v
retrieving revision 1.1.2.4
diff -c -3 -p -r1.1.2.4 loop-init.c
*** loop-init.c 8 Dec 2002 14:36:30 -0000 1.1.2.4
--- loop-init.c 8 Dec 2002 18:42:18 -0000
*************** loop_optimizer_init (dumpfile)
*** 56,61 ****
--- 56,67 ----
return NULL;
}
+ /* Not going to update these. */
+ free (loops->cfg.rc_order);
+ loops->cfg.rc_order = NULL;
+ free (loops->cfg.dfs_order);
+ loops->cfg.dfs_order = NULL;
+
/* Initialize structures for layout changes. */
cfg_layout_initialize (loops);
*************** loop_optimizer_finalize (loops, dumpfile
*** 98,107 ****
RBI (bb)->next = bb->next_bb;
/* Another dump. */
- free (loops->cfg.rc_order);
- loops->cfg.rc_order = NULL;
- free (loops->cfg.dfs_order);
- loops->cfg.dfs_order = NULL;
flow_loops_dump (loops, dumpfile, NULL, 1);
/* Clean up. */
--- 104,109 ----
Index: profile.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/profile.c,v
retrieving revision 1.97.2.7
diff -c -3 -p -r1.97.2.7 profile.c
*** profile.c 8 Dec 2002 14:36:31 -0000 1.97.2.7
--- profile.c 8 Dec 2002 18:42:19 -0000
*************** branch_prob ()
*** 1350,1366 ****
}
}
! if (flag_loop_histograms)
{
! /* Find loops and bring them into canonical shape. */
! flow_loops_find (&loops, LOOP_TREE);
! create_preheaders (&loops, 0);
! /* Release dominators -- we aren't going to need them nor update them. */
! if (loops.cfg.dom)
! {
! free_dominance_info (loops.cfg.dom);
! loops.cfg.dom = NULL;
! }
}
el = create_edge_list ();
--- 1350,1365 ----
}
}
! /* Find loops and bring them into canonical shape. We only need this when
! we profile loop histograms, but we may want to use the data collected
! with loop profiling without it. */
! flow_loops_find (&loops, LOOP_TREE);
! create_preheaders (&loops, 0);
! /* Release dominators -- we aren't going to need them nor update them. */
! if (loops.cfg.dom)
{
! free_dominance_info (loops.cfg.dom);
! loops.cfg.dom = NULL;
}
el = create_edge_list ();
*************** branch_prob ()
*** 1612,1622 ****
}
}
! if (flag_loop_histograms)
! {
! /* Free the loop datastructure. */
! flow_loops_free (&loops);
! }
if (flag_value_histograms)
{
--- 1611,1618 ----
}
}
! /* Free the loop datastructure. */
! flow_loops_free (&loops);
if (flag_value_histograms)
{
Index: ra.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ra.c,v
retrieving revision 1.4.2.1
diff -c -3 -p -r1.4.2.1 ra.c
*** ra.c 8 Dec 2002 14:36:32 -0000 1.4.2.1
--- ra.c 8 Dec 2002 18:42:19 -0000
*************** reg_alloc ()
*** 859,865 ****
if ((debug_new_regalloc & DUMP_LAST_FLOW) == 0)
rtl_dump_file = NULL;
life_analysis (get_insns (), rtl_dump_file,
! PROP_DEATH_NOTES | PROP_LOG_LINKS | PROP_REG_INFO);
cleanup_cfg (CLEANUP_EXPENSIVE);
recompute_reg_usage (get_insns (), TRUE);
if (rtl_dump_file)
--- 859,865 ----
if ((debug_new_regalloc & DUMP_LAST_FLOW) == 0)
rtl_dump_file = NULL;
life_analysis (get_insns (), rtl_dump_file,
! PROP_DEATH_NOTES | PROP_REG_INFO);
cleanup_cfg (CLEANUP_EXPENSIVE);
recompute_reg_usage (get_insns (), TRUE);
if (rtl_dump_file)
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.668.2.13
diff -c -3 -p -r1.668.2.13 toplev.c
*** toplev.c 8 Dec 2002 14:36:37 -0000 1.668.2.13
--- toplev.c 8 Dec 2002 18:42:19 -0000
*************** rest_of_compilation (decl)
*** 3206,3212 ****
/* Insns were inserted, so things might look a bit different. */
insns = get_insns ();
update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! PROP_LOG_LINKS | PROP_REG_INFO
| PROP_DEATH_NOTES);
}
}
--- 3206,3212 ----
/* Insns were inserted, so things might look a bit different. */
insns = get_insns ();
update_life_info_in_dirty_blocks (UPDATE_LIFE_GLOBAL_RM_NOTES,
! PROP_REG_INFO
| PROP_DEATH_NOTES);
}
}
*************** rest_of_compilation (decl)
*** 3224,3229 ****
--- 3224,3230 ----
timevar_push (TV_COMBINE);
open_dump_file (DFI_combine, decl);
+ update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_LOG_LINKS);
rebuild_jump_labels_after_combine
= combine_instructions (insns, max_reg_num ());
*************** rest_of_compilation (decl)
*** 3267,3272 ****
--- 3268,3274 ----
timevar_push (TV_REGMOVE);
open_dump_file (DFI_regmove, decl);
+ update_life_info (NULL, UPDATE_LIFE_LOCAL, PROP_LOG_LINKS);
regmove_optimize (insns, max_reg_num (), rtl_dump_file);
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);