This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] More type narrowing in match.pd V2
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 May 2015 14:47:50 +0200
- Subject: Re: [RFA] More type narrowing in match.pd V2
- Authentication-results: sourceware.org; auth=none
- References: <55441BF2 dot 60703 at redhat dot com> <alpine dot DEB dot 2 dot 02 dot 1505141554100 dot 30908 at stedding dot saclay dot inria dot fr> <5554B11E dot 8090705 at redhat dot com> <CAFiYyc32_u6VsEjdfqDObSy+GJH70gAd71nvuvHTXEFWkqSTfw at mail dot gmail dot com> <alpine dot DEB dot 2 dot 11 dot 1505181432460 dot 1779 at laptop-mg dot saclay dot inria dot fr>
On Mon, May 18, 2015 at 2:34 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Mon, 18 May 2015, Richard Biener wrote:
>
>> On Thu, May 14, 2015 at 4:28 PM, Jeff Law <law@redhat.com> wrote:
>>>
>>> On 05/14/2015 08:04 AM, Marc Glisse wrote:
>>>>
>>>>
>>>> On Fri, 1 May 2015, Jeff Law wrote:
>>>>
>>>>> Slight refactoring of the condition by using types_match as suggested
>>>>> by Richi. I also applied the new types_match to 2 other patterns in
>>>>> match.pd where it seemed clearly appropriate.
>>>>
>>>>
>>>>
>>>> I would like to propose this small tweak (regtested ok). If we had a
>>>> different type for trees and types, this would be overloading the
>>>> function. We already do this in a few places, and I find the resulting
>>>> shorter code more readable.
>>>>
>>>> 2015-05-14 Marc Glisse <marc.glisse@inria.fr>
>>>>
>>>> * generic-match-head.c (types_match): Handle non-types.
>>>> * gimple-match-head.c (types_match): Likewise.
>>>> * match.pd: Remove unnecessary TREE_TYPE for types_match.
>>>
>>>
>>> Update the comment for types_match and this is fine.
>>
>>
>> No - it breaks genmatch autodetection of what trees escape. It
>> special-cases
>> TREE_TYPE (). See capture_info::walk_c_expr:
>
>
> Oh, I didn't know that.
>
>> /* Give up for C exprs mentioning captures not inside TREE_TYPE (). */
>> unsigned p_depth = 0;
>>
>> so the patch will pessimize GENERIC folding.
>>
>> Please do not apply.
>
>
> I think it was already applied. Feel free to revert it, or tell me and I'll
> do it next week-end (from your next message I don't really know if it should
> be reverted or not).
It's always good to compare generated code (gimple/generic-match.c in the
build directory) for such changes. Only the obvious differences should appear.
If they do you can leave the patch in.
Richard.
> --
> Marc Glisse