public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Will Schmidt <will_schmidt@vnet.ibm.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	       "William J. Schmidt" <wschmidt@linux.vnet.ibm.com>,
	       David Edelsohn <dje.gcc@gmail.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH, rs6000] Improve TREE_TYPE comparisons in fold_mergehl_helper()
Date: Mon, 20 Aug 2018 22:07:00 -0000	[thread overview]
Message-ID: <20180820220740.GM24439@gate.crashing.org> (raw)
In-Reply-To: <1534801235.26070.16.camel@brimstone.rchland.ibm.com>

Hi Will,

On Mon, Aug 20, 2018 at 04:40:35PM -0500, Will Schmidt wrote:
> This is a follow-up to an earlier patch that enabled gimple folding of
> vec_mergeh and vec_mergel for the float and double data types.
> 
> Per feedback from Richard, use the types_compatible_p helper to ensure
> we also catch any qualified types matching the V2DF_ or V4SF_ types.

That looks fine; if no one hollers, please commit.  Thanks!

I note we use lang_hooks.types_compatible_p a lot, which is a totally
different thing?  How confusing :-/


Segher


> 2018-08-20  Will Schmidt  <will_schmidt@vnet.ibm.com>
> 
> 	* config/rs6000/rs6000.c (fold_mergehl_helper): Add types_compatible_p
> 	wrappers around TREE_TYPE comparisons.
> 
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> index 97b922f..5f77afd 100644
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -15135,13 +15135,15 @@ fold_mergehl_helper (gimple_stmt_iterator *gsi, gimple *stmt, int use_high)
>    tree permute_type;
>    if (INTEGRAL_TYPE_P (TREE_TYPE (lhs_type)))
>      permute_type = lhs_type;
>    else
>      {
> -      if (TREE_TYPE (lhs_type) == TREE_TYPE (V2DF_type_node))
> +      if (types_compatible_p (TREE_TYPE (lhs_type),
> +			      TREE_TYPE (V2DF_type_node)))
>  	permute_type = V2DI_type_node;
> -      else if (TREE_TYPE (lhs_type) == TREE_TYPE (V4SF_type_node))
> +      else if (types_compatible_p (TREE_TYPE (lhs_type),
> +				   TREE_TYPE (V4SF_type_node)))
>  	permute_type = V4SI_type_node;
>        else
>  	gcc_unreachable ();
>      }
>    tree_vector_builder elts (permute_type, VECTOR_CST_NELTS (arg0), 1);
> 

  reply	other threads:[~2018-08-20 22:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 19:25 [PATCH, rs6000] Early gimple folding of vec_mergeh and vec_mergel for float Will Schmidt
2018-08-07 22:59 ` Segher Boessenkool
2018-08-17 14:01   ` Richard Biener
2018-08-17 15:05     ` Will Schmidt
2018-08-17 15:16       ` Richard Biener
2018-08-20 21:40         ` [PATCH, rs6000] Improve TREE_TYPE comparisons in fold_mergehl_helper() Will Schmidt
2018-08-20 22:07           ` Segher Boessenkool [this message]
2018-08-21  8:10             ` Richard Biener

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=20180820220740.GM24439@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=will_schmidt@vnet.ibm.com \
    --cc=wschmidt@linux.vnet.ibm.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).