This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: A few little loop.c cleanup patches


    Wouldn't you want to do unrolling before strength reduction?  Given
    something like

        for (i = 0; i < 100; ++i)
          x[i] += 2;

    and a machine with sensible displacements, you'd want the x+0, x+4, 
    x+8, x+12 to use one reduced register.  I'm not sure how this is
    handled now (or if it is), but surely it would be easier to just
    do unrolling earlier.

My view is that you want to do it *in the middle* of strength reduction.
You first identify the bivs and givs, then unroll the loop updating the biv
and giv data, then finish the strength reduction.  I've felt for a long time
that that approach will both be the simplest and give the best code.

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