summaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
authordje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-03 16:32:45 +0000
committerdje <dje@138bc75d-0d04-0410-961f-82ee72b054a4>2004-03-03 16:32:45 +0000
commit839f841511dc0908d11199c48add0335fd068928 (patch)
treea9a88dd3608db538ae3d670cde68145ab19f3038 /gcc/passes.c
parent399d212bf0da5ed1e49763af597f5cdbcdc40acf (diff)
downloadgcc-839f841511dc0908d11199c48add0335fd068928.tar.gz
2004-03-03 Mostafa Hagog <mustafa@il.ibm.com>
* common.opt: Add description of the new -fgcse-after-reload flag. * flags.h (flag_gcse_after_reload): Declaration of global variable. * gcse.c (reg_used_on_edge ,reg_set_between_after_reload_p, reg_used_between_after_reload_p, rtx get_avail_load_store_reg, is_jump_table_basic_block, bb_has_well_behaved_predecessors, get_bb_avail_insn, hash_scan_set_after_reload, compute_hash_table_after_reload, eliminate_partially_redundant_loads, gcse_after_reload, get_bb_avail_insn): New functions to implement gcse-after-reload. (gcse_after_reload_main): New function, the main entry point to gcse-after-reload. * rtl.h (gcse_after_reload_main): Declaration of the new function. * opts.c (common_handle_option): Handle the -fgcse-after-reload flag. * toplev.c (flag_gcse_after_reload): Initialization. * passes.c (rest_of_handl_gcse2): Call gcse_after_reload_main. * params.def (PARAM_GCSE_AFTER_RELOAD_PARTIAL_FRACTION, PARAM_GCSE_AFTER_RELOAD_CRITICAL_FRACTION): New parameters for tuning the gcse after reload optimization. * params.h (GCSE_AFTER_RELOAD_PARTIAL_FRACTION, GCSE_AFTER_RELOAD_CRITICAL_FRACTION): Two macros to access the tuning parameters. * doc/invoke.texi: Documentation for the new flag gcse-after-reload. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78842 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index 1b012772f4b..1bd554c61e1 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -158,6 +158,7 @@ enum dump_file_index
DFI_lreg,
DFI_greg,
DFI_postreload,
+ DFI_gcse2,
DFI_flow2,
DFI_peephole2,
DFI_ce3,
@@ -178,7 +179,7 @@ enum dump_file_index
Remaining -d letters:
" e m q "
- " JK O Q WXY "
+ " K O Q WXY "
*/
static struct dump_file_info dump_file_tbl[DFI_MAX] =
@@ -210,6 +211,7 @@ static struct dump_file_info dump_file_tbl[DFI_MAX] =
{ "lreg", 'l', 1, 0, 0 },
{ "greg", 'g', 1, 0, 0 },
{ "postreload", 'o', 1, 0, 0 },
+ { "gcse2", 'J', 0, 0, 0 },
{ "flow2", 'w', 1, 0, 0 },
{ "peephole2", 'z', 1, 0, 0 },
{ "ce3", 'E', 1, 0, 0 },
@@ -788,6 +790,23 @@ rest_of_handle_sched2 (tree decl, rtx insns)
}
#endif
+static void
+rest_of_handle_gcse2 (tree decl, rtx insns)
+{
+ open_dump_file (DFI_gcse2, decl);
+
+ gcse_after_reload_main (insns, dump_file);
+ rebuild_jump_labels (insns);
+ delete_trivially_dead_insns (insns, max_reg_num ());
+ close_dump_file (DFI_gcse2, print_rtl_with_bb, insns);
+
+ ggc_collect ();
+
+#ifdef ENABLE_CHECKING
+ verify_flow_info ();
+#endif
+}
+
/* Register allocation pre-pass, to reduce number of moves necessary
for two-address machines. */
static void
@@ -1842,6 +1861,9 @@ rest_of_compilation (tree decl)
close_dump_file (DFI_postreload, print_rtl_with_bb, insns);
+ if (optimize > 0 && flag_gcse_after_reload)
+ rest_of_handle_gcse2 (decl, insns);
+
/* Re-create the death notes which were deleted during reload. */
timevar_push (TV_FLOW2);
open_dump_file (DFI_flow2, decl);