This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][Modulo-sched] Avoid SMS when the candidate loop contains INC instruction

Kenneth Zadeck <> wrote on 26/07/2007

> > Hello,
> >
> > We decided to break Patch 1 of 2 into sub-patches and insert them
> > gradually.  (
> >
> > 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
register defined.

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.


> Kenny
> >
> > :ADDPATCH modulo-sched:
> >
> > OK for mainline?
> >
> > Thanks,
> > Revital
> >
> > 2007-07-26  Vladimir Yanovsky  <>
> >
> >         * modulo-sched.c (sms_schedule): Avoid loops which includes
> >         auto-increment instructions.
> >
> >         * testsuite/gfortran.dg/sms-1.f90: New test.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]