This is the mail archive of the gcc@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]
Other format: [Raw text]

Re: Turning off unrolling to certain loops


Dear all,

I've been working on a loop unrolling scheme and I have a few questions:

1) Is there an interest in having a loop unrolling scheme for GCC? I'm
working on the 4.3.2 version but can port it afterwards to the 4.5
version or any version you think is appropriate.

2) I was using a simple example:

#pragma unroll 2
        for (i=0;i<6;i++)
        {
            printf ("Hello world\n");
        }

If I do this, instead of transforming the code into :
        for (i=0;i<3;i++)
        {
            printf ("Hello world\n");
            printf ("Hello world\n");
        }

as we could expect, it is transformed into:
        for (i=0;i<2;i++)
        {
            printf ("Hello world\n");
            printf ("Hello world\n");
        }
        for (i=0;i<2;i++)
        {
            printf ("Hello world\n");
        }


(I am using 4.3.2 currently)

I am using the tree_unroll_loop function to perform the unrolling and
it seems to always want to keep that epilogue. Is there a reason for
this? Or is this a bug of some sorts?

It seems that because the unrolling function wants always have this epilogue.

I've moved forwards (debugging wise) on this also but will wait to
know a bit of your input. I'll be looking at how to remove this
epilogue when it is not needed.

Thanks in advance,
Jc


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