This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Question] How to deliver loop-related pragma information from TREE to RTL?
- From: "Yangfei (Felix)" <felix dot yang at huawei dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, Felix Yang <fei dot yang0953 at gmail dot com>, "Zhanghui (hilary)" <zhanghui2 at huawei dot com>
- Date: Tue, 25 Mar 2014 03:01:07 +0000
- Subject: Re: [Question] How to deliver loop-related pragma information from TREE to RTL?
- Authentication-results: sourceware.org; auth=none
- References: <DA41BE1DDCA941489001C7FBD7A8820E54A4CA0F at szxema507-mbx dot china dot huawei dot com> <CAFiYyc3ZgAZ7PYOKE-V73+Z6O0qqwX++B3vs0qU9hB5MigSn=Q at mail dot gmail dot com>
Hi Richard,
Thank you for the suggestion. I see that your patch is merged into trunk.
But I am still not sure that if we can pass "ivdep" to RTL. Can you shed light on this please ?
For me, I want to do something on RTL with the loop pragma information.
Cheers,
Fei.
>
> On Mon, Mar 24, 2014 at 1:46 PM, Yangfei (Felix) <felix.yang@huawei.com>
> wrote:
> > Hello everyone,
> >
> > I'm thinking of the right way of adding some loop related pragmas to
> GCC.
> > An example:
> >
> > #pragma loop unroll = 2
> > for (i = 0; i < n; i ++)
> > {
> > Whatever...
> > }
> >
> > Here I want the unroll factor of the loop to be 2 when doing RTL loop
> unrolling.
> > But I find that it's kind of difficult to achieve this in GCC.
> > The reason is that the loop structures are initialized and finalized at run
> time. Also the RTL expand phase is kind of complex and it does not care about
> loops.
> > So how to deliver the pragma information to RTL loop unrolling pass?
> What the the elegant way of doing this?
> > Can anyone give some suggestions on this please?
>
> Look at how we implement #pragma ivdep (see replace_loop_annotate () and
> fortran/trans-stmt.c where it builds ANNOTATE_EXPR).
>
> Richard.
>
> > Many thanks.
> >