Patch for AMD Dispatch Scheduler

reza yazdani yazdani_reza@yahoo.com
Fri Aug 13 00:44:00 GMT 2010


Dispatch scheduling is a new BD feature. It is composed of two parts: the scheduling part and the alignment part.

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.

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.

Testing
-------

Self compile ran with “–mdispatch-scheduling –O3”. 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.

ChangeLog
---------

2010-08-12  Reza Yazdani  <reza.yazdani@amd.com>

    * tm.texi.in (TARGET_SCHED_DISPATCH): New.
    (TARGET_SCHED_DISPATCH_INIT): New.
    (TARGET_SCHED_ADD_TO_DISPATCH_WINDOW): New.
    (TARGET_SCHED_FITS_DISPATCH_WINDOW): New.
    (TARGET_SCHED_DISPATCH_VIOLATION): New,
    (TARGET_SCHED_DEBUG_PRINT_INSN_DISPATCH_INFO): New.
    * tm.texi: Regererated.
    * hooks.c (hook_void_rtx): New.
    * hooks.h (hook_void_rtx): New.
    * target.def (dispatch_init): Defined.
    (dispatch): Defined.
    (fits_dispatch_window): Defined.
    (dispatch_violation): Defined.
    (is_cmp): Defined.
    (debug_print_insn_dispatch_info): Defined.
    (add_to_dispatch_window): Defined.
    * haifa-sched.c (ready_remove_first_dispatch): New.
    (debug_ready_dispatch): New.
    (debug_ready_dispatch): New.
    * sched-init.h (debug_ready_dispatch): Declared.
    * i386.h (debug_print_dispatch_window): Declared.
    (debug_print_insn_dispatch_info): Declared.
    * i386.opt (-mdispatch-scheduler): Declared.
    (flag_dispatch_scheduling): Declared.
    * i386.c (has_dispatch): New.
    (get_mem_group): New.
    (is_cmp): New.
    (dispatch_violation): New.
    (is_branch): New.
    (is_prefetch): New.
    (init_window): New.
    (allocate_window): New.
    (init_dispatch_sched): New.
    (is_end_basic_block): New.
    (process_end_window): New.
    (allocate_next_window): New.
    (find_con): New.
    (get_num_imm): New.
    (has_imm): New.
    (get_insn_length): New.
    (get_insn_path): New.
    (get_insn_group): New.
    (count_num_restricted): New.
    (fits_dispatch_window): New.
    (add_insn_window): New.
    (add_to_dispatch_window): New.
    (print_dispatch_window): New.
    (debug_print_dispatch_window): New.
    (print_insn_dispatch_info): New.
    (debug_print_insn_dispatch_info): New.


      
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dispatch.diff
Type: text/x-patch
Size: 35965 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100813/b48c7028/attachment.bin>


More information about the Gcc-patches mailing list