This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[cfg-branch] trace scheduling
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, gcc-pdo at atrey dot karlin dot mff dot cuni dot cz
- Date: Sat, 20 Apr 2002 14:30:13 +0200
- Subject: [cfg-branch] trace scheduling
Hi,
as promised yesterday, this should add the trace scheduling support. THe
superblock scheduling without profile seems to be small loss on Athlon
according to the Andrea's benchamrks. I guess it is because we do quite a lot
of speculative execution in belief that it is for free because of our
inaccurate Athlon CPU model having little benefits as Athlon does speculative
execution himself.
I would be curious about results on non-out of order architectures.
Honza
Sat Apr 20 14:18:37 CEST 2002 Jan Hubicka <jh@suse.cz>
* toplev.c (flag_trace_scheduling): New static variable
(lang_independent_options): add -fschedule-traces
(rest_of_compilation): Avoid crossjumping before sched2
when scheduling traces;
(parse_options_and_default_flags): Enable trace scheduling at -O2.
(process_options): WHen trace scheduling is enabled, enable
superblock scheduling and tracer.
When superblock scheudling, enable schedule_insns2 pass.
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.537.2.68
diff -c -3 -p -r1.537.2.68 toplev.c
*** toplev.c 19 Apr 2002 22:44:41 -0000 1.537.2.68
--- toplev.c 20 Apr 2002 12:14:57 -0000
*************** int flag_pedantic_errors = 0;
*** 740,746 ****
global_alloc. */
int flag_schedule_insns = 0;
! static int flag_superblock_scheduling = 1;
int flag_schedule_insns_after_reload = 0;
/* The following flags have effect only for scheduling before register
--- 740,747 ----
global_alloc. */
int flag_schedule_insns = 0;
! static int flag_superblock_scheduling = 0;
! static int flag_trace_scheduling = 0;
int flag_schedule_insns_after_reload = 0;
/* The following flags have effect only for scheduling before register
*************** static const lang_independent_options f_
*** 1084,1089 ****
--- 1085,1092 ----
N_("Reschedule instructions before register allocation") },
{"schedule-superblocks", &flag_superblock_scheduling, 1,
N_("When scheduling, do superblock sheduling") },
+ {"schedule-traces", &flag_trace_scheduling, 1,
+ N_("When scheduling, do trace sheduling") },
{"schedule-insns2", &flag_schedule_insns_after_reload, 1,
N_("Reschedule instructions after register allocation") },
{"sched-interblock",&flag_schedule_interblock, 1,
*************** rest_of_compilation (decl)
*** 3440,3446 ****
{
life_analysis (get_insns (), rtl_dump_file, PROP_FINAL);
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
/* This is kind of a heuristic. We need to run combine_stack_adjustments
even for machines with possibly nonzero RETURN_POPS_ARGS
--- 3443,3450 ----
{
life_analysis (get_insns (), rtl_dump_file, PROP_FINAL);
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
! | (flag_crossjumping && !flag_trace_scheduling
! ? CLEANUP_CROSSJUMP : 0));
/* This is kind of a heuristic. We need to run combine_stack_adjustments
even for machines with possibly nonzero RETURN_POPS_ARGS
*************** rest_of_compilation (decl)
*** 3518,3528 ****
/* No liveness updating code yet, but it should be easy to do */
count_or_remove_death_notes (NULL, 1);
life_analysis (get_insns (), rtl_dump_file, PROP_FINAL);
}
else
schedule_insns (rtl_dump_file);
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
- | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
close_dump_file (DFI_sched2, print_rtl_with_bb, get_insns ());
timevar_pop (TV_SCHED2);
--- 3522,3532 ----
/* No liveness updating code yet, but it should be easy to do */
count_or_remove_death_notes (NULL, 1);
life_analysis (get_insns (), rtl_dump_file, PROP_FINAL);
+ cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE
+ | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
}
else
schedule_insns (rtl_dump_file);
close_dump_file (DFI_sched2, print_rtl_with_bb, get_insns ());
timevar_pop (TV_SCHED2);
*************** parse_options_and_default_flags (argc, a
*** 4889,4894 ****
--- 4893,4899 ----
#ifdef INSN_SCHEDULING
flag_schedule_insns = 1;
flag_schedule_insns_after_reload = 1;
+ flag_trace_scheduling = 1;
#endif
flag_regmove = 1;
flag_strict_aliasing = 1;
*************** process_options ()
*** 5084,5089 ****
--- 5089,5098 ----
/* Same for new loop unrolling. */
if (flag_new_unroll_all_loops)
flag_new_unroll_loops = 1;
+ if (flag_trace_scheduling)
+ flag_superblock_scheduling = flag_tracer = 1;
+ if (flag_superblock_scheduling)
+ flag_schedule_insns_after_reload = 1;
if (flag_unroll_all_loops && flag_new_unroll_loops)
flag_new_unroll_all_loops = 1;