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: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: 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: Mon, 24 Mar 2014 22:11:48 +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>
> 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)
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?
--
Eric Botcazou