This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][Modulo-sched] Avoid SMS when the candidate loop contains INC instruction
- From: Ayal Zaks <ZAKS at il dot ibm dot com>
- To: Kenneth dot Zadeck at NaturalBridge dot com
- Cc: abel at ispras dot ru, gcc-patches at gcc dot gnu dot org, volodyan at gmail dot com
- Date: Thu, 26 Jul 2007 20:54:48 +0300
- Subject: Re: [PATCH][Modulo-sched] Avoid SMS when the candidate loop contains INC instruction
Kenneth Zadeck <Kenneth.Zadeck@NaturalBridge.com> wrote on 26/07/2007
> > Hello,
> > We decided to break Patch 1 of 2 into sub-patches and insert them
> > gradually. (http://gcc.gnu.org/ml/gcc-patches/2007-07/msg01515.html)
> > This is the first one which avoids performing SMS when the candidate
> > loop contains auto-increment instruction.
> > The testcase attached is inspired from array_constructor_12.f90
> > This patch was bootstrapped and tested on ppc64 with -fmodulo-sched
> > flag. (all languages except Ada)
> This really cannot be the right thing to do.
> If you have a loop that you want to modulo schedule, you should expand
> the autoinc insn back into two insns. If you really find some reason
> why you do not want to do that, then you should not run the auto inc
> finding pass when you enable modulo scheduling.
Indeed chickening-out in the face of autoinc's is not the right thing to
The current problem that sms has with autoinc insns is that they have
multiple defs. If one of these defs ends up needing a regmove, we need to
figure out which def it is. That would be the right thing to do. An
alternative is to avoid needing regmoves specifically for such multiple
defs. Currently sms assumes such regmove-needing-defs are the only defs of
their insn, i.e. their lhs. This is also related to the current
restriction to single_set insns. There may be another difficulty for sms
with the destructive nature of autoinc insns: sms may want to rename the
address register used (to hook it up to a regmove) without changing the
In any case, there are several fixes that address known issues which we'd
like to push through, making forward progress, noting todo/??? items along
the way, and also providing statistics dumps of which restriction are
encountered in practice.
> > :ADDPATCH modulo-sched:
> > OK for mainline?
> > Thanks,
> > Revital
> > 2007-07-26 Vladimir Yanovsky <firstname.lastname@example.org>
> > * modulo-sched.c (sms_schedule): Avoid loops which includes
> > auto-increment instructions.
> > * testsuite/gfortran.dg/sms-1.f90: New test.