This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC][PR target/39726 P4 regression] match.pd pattern to do type narrowing
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Joseph Myers <joseph at codesourcery dot com>,GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 03 Feb 2015 12:39:49 +0100
- Subject: Re: [RFC][PR target/39726 P4 regression] match.pd pattern to do type narrowing
- Authentication-results: sourceware.org; auth=none
- References: <54CC560B dot 8080200 at redhat dot com> <alpine dot DEB dot 2 dot 10 dot 1502010039210 dot 23456 at digraph dot polyomino dot org dot uk> <54CDBDC6 dot 3050000 at redhat dot com> <CAFiYyc1JD+icnCuNdcDUKj-R2Au7JdkuezFT1=GstBLQ69KxdA at mail dot gmail dot com> <54CFC2AF dot 1040405 at redhat dot com>
On February 2, 2015 7:32:15 PM CET, Jeff Law <law@redhat.com> wrote:
>On 02/02/15 01:57, Richard Biener wrote:
>>>
>>> The nice thing about wrapping the result inside a convert is the
>types for
>>> the inner operations will propagate from the type of the inner
>operands,
>>> which is exactly what we want. We then remove the hack assigning
>type and
>>> instead the original type will be used for the outermost convert.
>>
>> It's not even a hack but wrong ;) Correct supported syntax is
>>
>> + (with { tree type0 = TREE_TYPE (@0); }
>> + (convert:type0 (bit_and (inner_op @0 @1) (convert @3)))))))
>>
>> Thus whenever the generator cannot auto-guess a type (or would guess
>> the wrong one) you can explicitely specify a type to convert to.
>I found that explicit types were ignored in some cases. It was
>frustrating to say the least.
Huh, that would be a bug. Do you have a pattern where that happens?
Richard.
But I think I've got this part doing
>what
>I want without the hack.
>
>>
>> Why do you restrict this to GENERIC? On GIMPLE you'd eventually
>> want to impose some single-use constraints as the result with all
>> the conversions won't really be unconditionally "better"?
>That was strictly because of the mismatch between the resulting type
>and
>how it was later used. That restriction shouldn't be needed anymore.
>
>Jeff