This is the mail archive of the
mailing list for the GCC project.
Re: Patch for AMD Dispatch Scheduler
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: reza yazdani <yazdani_reza at yahoo dot com>
- Cc: gcc-patches at gcc dot gnu dot org, jh at suse dot cz, ubizjak at gmail dot com, sebpop at gmail dot com, Richard Henderson <rth at redhat dot com>
- Date: Tue, 31 Aug 2010 16:23:11 -0400
- Subject: Re: Patch for AMD Dispatch Scheduler
- References: <firstname.lastname@example.org>
On 08/24/2010 06:02 PM, reza yazdani wrote:
Dispatch scheduling is a new BD feature. It is composed of two parts: the scheduling part and the alignment part.Thanks for addressing this issue. The scheduler part (haifa-sched.c) is
ok. I'd move external declaration debug_ready_dispatch and
debug_dispatch_window from sched-int.h to i386.h because they are
defined there. Sched-int.h for definitions of machine-dependent parts
of insn scheduler.
The scheduling part (this patch) arranges instructions to maximize the throughput of the hardware dispatcher. It makes sure dispatch widow boundaries are roughly observed. It is roughly, because the lengths of instructions, in number of bytes, are not known at the scheduling time. In x86 some instruction lengths may not be known until assembly time where information such as branch offsets are computed. Scheduling part is called once before register allocation and once after register allocation.
The alignment part (not in this patch) makes sure dispatch widows align at the correct boundaries.
Dispatch Scheduling is implemented as an extension to Haifa Scheduler pass. Scheduler is programed to follow x86-BD dispatching rules during the scheduling.
2 GCC hook functions are used to communicate from the machine independent part to the machine dependent parts of the scheduler.
A new command line flag âmdispatch-scheduler is defined. This option sets flag_dispatch_scheduling. To perform dispatch scheduling â-march=bdver1â and Haifa Scheduling flags must all be selected on the command line.
Self compile ran with ââmdispatch-scheduling -fschedule-insns -fsched-pressure âO2". Dispatch scheduling flag was manually set on in the self compile to exercise the new code. No new test added for this implementation. Make check of i386 tests passes. No difference in the number of failures with and without the dispatch flag.
2010-08-12 Reza Yazdani<email@example.com>
* tm.texi.in (TARGET_SCHED_DISPATCH): New.
* tm.texi: Regererated.
* hooks.c (hook_bool_rtx_int_false): New.
* hooks.h (hook_bool_rtx_int_false): New.
* target.def (dispatch): Defined.
* haifa-sched.c (ready_remove_first_dispatch): New.
* sched-init.h (get_ready_element): Declared.
* i386.opt (-mdispatch-scheduler): Declared.
* i386.c (has_dispatch): New.
Previous communications regarding this patch:
There were complains that there are too many hooks in my implementation. I changed the interface and only two hooks are used in the current implementation. One for boolean functions and one for action routines.