This is the mail archive of the
mailing list for the GCC project.
Re: [Question] How to deliver loop-related pragma information from TREE to RTL?
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, "Yangfei (Felix)" <felix dot yang at huawei dot com>, Felix Yang <fei dot yang0953 at gmail dot com>, "Zhanghui (hilary)" <zhanghui2 at huawei dot com>
- Date: Tue, 25 Mar 2014 11:15:21 +0100
- 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> <99697541 dot KlN9XirpAF at polaris>
On Mon, Mar 24, 2014 at 10:11 PM, Eric Botcazou <email@example.com> wrote:
>> Look at how we implement #pragma ivdep (see replace_loop_annotate ()
>> and fortran/trans-stmt.c where it builds ANNOTATE_EXPR).
> Note that the C and C++ front-ends also support it.
> We are planning to submit a patch to add more loop pragmas as soon as stage #1
> opens, so the design could as well be discussed now. In order to support the
> kind of pragmas suggested here, ANNOTATE_EXPR would need to get a 3rd argument
> /* ANNOTATE_EXPR.
> Operand 0 is the expression to be annotated.
> Operand 1 is the annotation kind.
> Operand 2 is the annotation value. */
> DEFTREECODE (ANNOTATE_EXPR, "annotate_expr", tcc_expression, 3)
Yep, that's fine.
> The current way of attaching the ANNOTATE_EXPR to the condition of the loop is
> a bit awkward since it doesn't naturally permit multiple annotations for a
> given loop. Any suggestion about how to overcome that?
You can certainly nest them, no?
ANNOTATE_EXPR <ANNOTATE_EXPR <i != 0, ivdep>, unroll, 2>
> Eric Botcazou