On Mon, Mar 24, 2014 at 10:11 PM, Eric Botcazou <ebotca...@adacore.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>

Richard.

> --
> Eric Botcazou

Reply via email to