[gomp4] remap variables inside gang, worker, vector and collapse clauses

Cesar Philippidis cesar@codesourcery.com
Wed Sep 23 18:56:00 GMT 2015

On 09/23/2015 11:26 AM, Thomas Schwinge wrote:
> On Wed, 23 Sep 2015 10:57:40 -0700, Cesar Philippidis <cesar@codesourcery.com> wrote:
>> On 09/23/2015 10:42 AM, Cesar Philippidis wrote:
>> | Gang, worker, vector and collapse all contain optional arguments which
>> | may be used during loop expansion. In OpenACC, those expressions could
>> | contain variables
> I'm fairly sure that at least the collapse clause needs to be a
> compile-time constant?

Thanks, you're correct. I was looking at a user application and not the
spec when I made this change. I've applied this patch to fix that.

>> | but those variables aren't always getting remapped
>> | automatically. This patch remaps those variables inside lower_omp_loop.
> Shouldn't that be done in lower_rec_input_clauses?  (Maybe I'm confused
> -- it's been a long time that I looked at this code.)  (Jakub?)

I thought that lower_rec_input_clauses was for omp reductions and
firstprivate initialization? Variables ultimately get remapped when
omplower eventually calls gimple_regimplify_operands. That function uses
the value-expr to for remapping.

In this case, since lower_omp_for is responsible for GIMPLE_OMP_FOR
stmts, gimple_regimplify_operands doesn't get called on the clauses.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: remove-collapse-remapping.diff
Type: text/x-patch
Size: 482 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150923/551e9dbd/attachment.bin>

More information about the Gcc-patches mailing list