This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[Question] How to deliver loop-related pragma information from TREE to RTL?
- From: "Yangfei (Felix)" <felix dot yang at huawei dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Cc: Felix Yang <fei dot yang0953 at gmail dot com>, "Zhanghui (hilary)" <zhanghui2 at huawei dot com>
- Date: Mon, 24 Mar 2014 12:46:20 +0000
- Subject: [Question] How to deliver loop-related pragma information from TREE to RTL?
- Authentication-results: sourceware.org; auth=none
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?
Many thanks.