This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Crossjumping before bb_reorder
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Subject: Crossjumping before bb_reorder
- From: Jan Hubicka <jh at suse dot cz>
- Date: Mon, 16 Jul 2001 18:26:18 +0200
Hi,
I am investigating the performance regression the jump2 killer patch has
caused on three tests of spec2000 suite.
One problem seems to be that I've killed the crossjumping after flow2 pass and
I do it only before it. Originally I expected this to not be problem, but
making another run after the flow2 pass adds some extra hits on complicated
functions. In combine.c there are 4 functions that allow extra
simplifications, so this patch moves the conditional crossjumping done in
reg-stack before bb_reorder, so bb_reorder sees the final file.
I've also moved the post-bb_reorder cleanup to make output to the debug file
to ensure that it does not employ extra code motion to undo the bb_reorder
decisions.
Honza
Mon Jul 16 18:21:35 CEST 2001 Jan Hubicka <jh@suse.cz>
* reg-stack.c (stack_regs_mentioned): Return 0 if
stack_regs_mentioned_data is not initialized.
(reg_to_stack): Make stack_regs_mentioned survive after the
reg-stack is completted; do not call cleanup_cfg.
* toplev.c (rest_of_compilation): Do cleanup_cfg before bb-reorder;
make cleanup_cfg after bb-reorder to output to debug file.
Index: reg-stack.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/reg-stack.c,v
retrieving revision 1.81
diff -c -3 -p -r1.81 reg-stack.c
*** reg-stack.c 2001/07/14 22:52:49 1.81
--- reg-stack.c 2001/07/16 16:21:13
*************** stack_regs_mentioned (insn)
*** 303,309 ****
unsigned int uid, max;
int test;
! if (! INSN_P (insn))
return 0;
uid = INSN_UID (insn);
--- 303,309 ----
unsigned int uid, max;
int test;
! if (! INSN_P (insn) || !stack_regs_mentioned_data)
return 0;
uid = INSN_UID (insn);
*************** reg_to_stack (first, file)
*** 419,424 ****
--- 419,431 ----
int max_uid;
block_info bi;
+ /* Clean up previous run. */
+ if (stack_regs_mentioned_data)
+ {
+ VARRAY_FREE (stack_regs_mentioned_data);
+ stack_regs_mentioned_data = 0;
+ }
+
if (!optimize)
split_all_insns (0);
*************** reg_to_stack (first, file)
*** 479,489 ****
VARRAY_CHAR_INIT (stack_regs_mentioned_data, max_uid + 1,
"stack_regs_mentioned cache");
- if (convert_regs (file) && optimize)
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_CROSSJUMP | CLEANUP_POST_REGSTACK);
-
- /* Clean up. */
- VARRAY_FREE (stack_regs_mentioned_data);
free (bi);
}
--- 486,491 ----
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.491
diff -c -3 -p -r1.491 toplev.c
*** toplev.c 2001/07/15 16:59:06 1.491
--- toplev.c 2001/07/16 16:21:14
*************** rest_of_compilation (decl)
*** 3672,3686 ****
ggc_collect ();
#endif
! if (optimize > 0 && flag_reorder_blocks)
{
timevar_push (TV_REORDER_BLOCKS);
open_dump_file (DFI_bbro, decl);
! reorder_basic_blocks ();
close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
timevar_pop (TV_REORDER_BLOCKS);
}
--- 3673,3694 ----
ggc_collect ();
#endif
! if (optimize > 0)
{
timevar_push (TV_REORDER_BLOCKS);
open_dump_file (DFI_bbro, decl);
! /* Last attempt to optimize CFG, as life analyzis possibly removed
! ome instructions. */
! cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
! | CLEANUP_CROSSJUMP);
! if (flag_reorder_blocks)
! {
! reorder_basic_blocks ();
! cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
! }
close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
timevar_pop (TV_REORDER_BLOCKS);
}