[PATCH][modulo-sched] New flag to control reg-moves generation

Revital1 Eres ERES@il.ibm.com
Thu Aug 2 07:24:00 GMT 2007


Hello,

This patch is the second one in the series of patches originated from
patch 1 of 2 (http://gcc.gnu.org/ml/gcc-patches/2007-01/msg01468.html).

As mentioned in a previous message we decided to split patch 1 of 2
into several sub patches; marking known problems in the way for later
handling in order to make a progress towards the insertion of the main
issue this patch address - the removal of the profitability check which
currently cripples SMS.  (The previous ddg patch that was submitted was
out of track as it was not related to patch 1 of 2)

Here is the list of issues patch 1 of 2 addresses: (a more
detailed description of those items is available also in
http://gcc.gnu.org/wiki/SwingModuloScheduling)

1.1 Avoid SMS when the loop contains inc instruction. (commited)
1.2 Fix removal of anti-deps.
1.3 Add -fsms-allow-reg-moves flag to control reg-moves generation.
1.4 Fix order of instructions within one cycle.
1.5 Remove profitability checks.

After those issues will be handled we intend to insert further
enhancements which includes the extension of the do-loop pattern
recognition (patch 2 of 2) and address the known problems.

The attached patch handles issues 1.2 and 1.3 above.  It introduces a
new flag -fmodulo-sched-allow-regmoves which controls the generation of
reg-moves and thus perform a more aggressive SMS.

When -fno-modulo-sched-allow-regmoves is set all the dependencies exist
in the ddg and no reg-moves are needed.

When -fmodulo-sched-allow-regmoves is set we delete certain anti-deps
edges and compensate for that by generating reg-moves based on the
life-range analysis.

The anti-deps that will be deleted are the ones which have true-deps edges
in the opposite direction (in other words the kernel has only one def).
By deleting those anti-deps edges the corresponding uses are allowed
to be scheduled further away from their def, even more than ii cycles
after their def (which can be detected by the life-range analysis). The
case where there is no such opposite true-dep edge (when there is
more than one def for the relevant register) we choose not to delete
the anti-dep edge for now as deleting such edge can violate this anti
dependence without having the corresponding life range exceed II cycles.
We intend to support the removal of all the anti-deps edges as part of
the enhancements plans mentioned above.

:ADDPATCH middle-end (modulo-sched):

This patch was bootstrapped and tested on PPC and x86_64 (also with
--enable-checking=assert), with and without -fmodulo-sched-allow-regmoves
flag.

OK for mainline?

Thanks,
Revital


2007-08-02  Vladimir Yanovsky  <yanov@il.ibm.com>
            Revital Eres <eres@il.ibm.com>

        * doc/invoke.texi (-fmodulo-sched-allow-regmoves): Document new
flag.
        * ddg.c (create_ddg_dependence): Do not check for interloop edges.
        Do not create anti dependence edge when a true dependence edge
        exists in the opposite direction and -fmodulo-sched-allow-regmoves
        is set.
        (add_cross_iteration_register_deps): Create anti dependence edge
        when -fno-modulo-sched-allow-regmoves is set.
        * common.opt (-fmodulo-sched-allow-regmoves): New flag.

        * gcc.dg/sms-antideps.c: New test.

(See attached file: sms-antideps.txt)(See attached file:
patch_reg_moves_flag_2_8.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: sms-antideps.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070802/c4801248/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_reg_moves_flag_2_8.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070802/c4801248/attachment-0001.txt>


More information about the Gcc-patches mailing list