public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <law@redhat.com>
Cc: Joseph Myers <joseph@codesourcery.com>,GCC Patches
	<gcc-patches@gcc.gnu.org>
Subject: Re: [RFC][PR target/39726 P4 regression] match.pd pattern to do type narrowing
Date: Tue, 03 Feb 2015 11:39:00 -0000	[thread overview]
Message-ID: <8B8165F1-1BF4-41EA-B680-D2C890D36C5B@gmail.com> (raw)
In-Reply-To: <54CFC2AF.1040405@redhat.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


  reply	other threads:[~2015-02-03 11:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31  8:53 Jeff Law
2015-02-01  0:47 ` Joseph Myers
2015-02-01  5:46   ` Jeff Law
2015-02-02  8:57     ` Richard Biener
2015-02-02 18:32       ` Jeff Law
2015-02-03 11:39         ` Richard Biener [this message]
2015-02-09  7:15           ` Jeff Law
2015-02-09 13:42             ` Richard Biener
2015-02-09 18:33               ` Jeff Law
2015-02-02 16:59     ` Joseph Myers
2015-02-02 18:04       ` Jeff Law
2015-02-03  7:20         ` Jeff Law
2015-02-03 12:23           ` Joseph Myers
2015-02-08  7:43             ` Jeff Law
2015-02-11  6:43             ` Jeff Law
2015-02-11 11:16               ` Richard Biener
2015-02-11 15:56                 ` Jeff Law
2015-02-11 16:06                   ` Jakub Jelinek
2015-02-11 17:13               ` Joseph Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8B8165F1-1BF4-41EA-B680-D2C890D36C5B@gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=law@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).