This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR middle-end/71488] Fix vectorization of comparison of booleans
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 27 Jun 2016 19:33:21 +0300
- Subject: Re: [PATCH, PR middle-end/71488] Fix vectorization of comparison of booleans
- Authentication-results: sourceware.org; auth=none
- References: <20160616110612 dot GB62320 at msticlxl57 dot ims dot intel dot com> <8b5553ea-a86d-0115-700d-d7abbf753cc7 at redhat dot com> <CAMbmDYa+7h0Pn8Yp-zHJ2EfduZoV=U75H_OkJroaq00D8Svn5Q at mail dot gmail dot com>
Looks like it caused PR71655 and therefore is not so safe :/
Ilya
2016-06-22 17:00 GMT+03:00 Ilya Enkovich <enkovich.gnu@gmail.com>:
> 2016-06-21 23:57 GMT+03:00 Jeff Law <law@redhat.com>:
>> On 06/16/2016 05:06 AM, Ilya Enkovich wrote:
>>>
>>> Hi,
>>>
>>> This patch fixes incorrect comparison vectorization for booleans.
>>> The problem is that regular comparison which works for scalars
>>> doesn't work for vectors due to different binary representation.
>>> Also this never works for scalar masks.
>>>
>>> This patch replaces such comparisons with bitwise operations
>>> which work correctly for both vector and scalar masks.
>>>
>>> Bootstrapped and regtested on x86_64-unknown-linux-gnu. Is it
>>> OK for trunk? What should be done for gcc-6-branch? Port this
>>> patch or just restrict vectorization for comparison of booleans?
>>>
>>> Thanks,
>>> Ilya
>>> --
>>> gcc/
>>>
>>> 2016-06-15 Ilya Enkovich <ilya.enkovich@intel.com>
>>>
>>> PR middle-end/71488
>>> * tree-vect-patterns.c (vect_recog_mask_conversion_pattern):
>>> Support
>>> comparison of boolean vectors.
>>> * tree-vect-stmts.c (vectorizable_comparison): Vectorize
>>> comparison
>>> of boolean vectors using bitwise operations.
>>>
>>> gcc/testsuite/
>>>
>>> 2016-06-15 Ilya Enkovich <ilya.enkovich@intel.com>
>>>
>>> PR middle-end/71488
>>> * g++.dg/pr71488.C: New test.
>>> * gcc.dg/vect/vect-bool-cmp.c: New test.
>>
>> OK. Given this is a code generation bug, I'll support porting this patch to
>> the gcc-6 branch. Is there any reason to think that porting out be more
>> risky than usual? It looks pretty simple to me, am I missing some subtle
>> dependency?
>
> I don't feel this patch is too risky. I asked only because simple restriction
> on masks comparison is even more safe.
>
> Thanks,
> Ilya
>
>
>>
>> jeff
>>