[PATCH][gomp4] Optimize expand_omp_for_static_chunk for chunk_size one

Tom de Vries Tom_deVries@mentor.com
Mon Aug 24 15:10:00 GMT 2015


On 24-08-15 16:28, Tom de Vries wrote:
> On 24-08-15 11:43, Jakub Jelinek wrote:
>> On Mon, Jul 28, 2014 at 11:21:53AM +0200, Tom de Vries wrote:
>>> Jakub,
>>>
>>> we're using expand_omp_for_static_chunk with a chunk_size of one to expand the
>>> openacc loop construct.
>>>
>>> This results in an inner and outer loop being generated, with the inner loop
>>> having a trip count of one, which means that the inner loop can be simplified to
>>> just the inner loop body. However, subsequent optimizations do not manage to do
>>> this simplification.
>>>
>>> This patch sets the loop exit condition to true if the chunk_size is one, to
>>> ensure that the compiler will optimize away the inner loop.
>>>
>>> OK for gomp4 branch?
>>>
>>> Thanks,
>>> - Tom
>>
>>> 2014-07-25  Tom de Vries  <tom@codesourcery.com>
>>>
>>>     * omp-low.c (expand_omp_for_static_chunk): Remove inner loop if
>>>     chunk_size is one.
>>
>> If that is still the case on the trunk, the patch is ok for trunk after
>> retesting it.  Please mention the PR tree-optimization/65468 in the
>> ChangeLog entry and make sure there is some runtime testcase that tests
>> that code path (both OpenMP and OpenACC one).
>>
>
> Committed attached patch to trunk.
>
> I'll look into openacc testcase for trunk.
>

Committed as attached.

Thanks,
- Tom


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-libgomp.oacc-c-c-common-vector-loop.c.patch
Type: text/x-patch
Size: 1262 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150824/748ee711/attachment.bin>


More information about the Gcc-patches mailing list