openacc reference reductions
Cesar Philippidis
cesar@codesourcery.com
Wed Apr 6 01:54:00 GMT 2016
On 02/22/2016 07:34 AM, Cesar Philippidis wrote:
> Ping. This patch still needs a review.
Ping. I've attached a rebased version of this patch. The omp-low.c bits
haven't changed, but the test cases have since Thomas has been merging
some of them from trunk. I separated the omp-low.c changes because the
test cases are relatively large.
This patch fixes PR70533 and PR70535. Basically it teaches
lower_oacc_reductions how to cope with reference-type variables
(PR70533) and not to remap the reduction variables on parallel
constructs (PR70535).
Is it OK for trunk?
Cesar
> On 02/09/2016 08:17 AM, Cesar Philippidis wrote:
>> On 02/09/2016 07:33 AM, Nathan Sidwell wrote:
>>> While I've not looked at the rest of the patch, this bit stood out:
>>>
>>>> +static bool
>>>> +is_oacc_parallel_reduction (tree var, omp_context *ctx)
>>>> +{
>>>> + if (!is_oacc_parallel (ctx))
>>>> + return false;
>>>> +
>>>> + tree clauses = gimple_omp_target_clauses (ctx->stmt);
>>>> +
>>>> + /* Don't install a local copy of the decl if it used
>>>> + inside a acc parallel reduction. */
>>>
>>> ^^ comment is misleading -- this routine's not installing anything
>>>
>>>> + if (is_oacc_parallel (ctx))
>>>
>>> ^^ already checked above.
>>>
>>>> + for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
>>>> + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
>>>> + && OMP_CLAUSE_DECL (c) == var)
>>>> + return true;
>>>> +
>>>> + return false;
>>>> +}
>>>> +
>>
>> Thanks for catching that. Those are artifacts from when this code used
>> to be located exclusively in scan_sharing_clauses. I've updated the
>> patch with those changes.
>>
>> Cesar
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr70533-omplow.diff
Type: text/x-patch
Size: 9744 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160406/f67bf9db/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr70533-tests.diff.gz
Type: application/gzip
Size: 9838 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160406/f67bf9db/attachment.gz>
More information about the Gcc-patches
mailing list