public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Oluwatamilore Adebayo <oluwatamilore.adebayo@arm.com>
To: <oluwatamilore.adebayo@arm.com>
Cc: <gcc-patches@gcc.gnu.org>, <richard.guenther@gmail.com>,
	<richard.sandiford@arm.com>
Subject: Re: [PATCH] vect: Missed opportunity to use [SU]ABD
Date: Thu, 8 Jun 2023 11:28:30 +0100	[thread overview]
Message-ID: <20230608102830.23565-1-oluwatamilore.adebayo@arm.com> (raw)
In-Reply-To: <20230606143446.50118-1-oluwatamilore.adebayo@arm.com>

New patch to address issue brought up in a different
thread: mptjzwgplp2.fsf@arm.com

> > +  /* Failed to find a widen operation so we check for a regular MINUS_EXPR.  */
> > +  if (diff
> > +      && gimple_assign_rhs_code (diff) == MINUS_EXPR
> > +      && (TYPE_UNSIGNED (abs_type) || TYPE_OVERFLOW_UNDEFINED (abs_type)))
> > +    {
> > +      *half_type = NULL_TREE;
> > +      return true;
> > +    }
> 
> the condition should instead be:
> 
>   if (diff
>       && gimple_assign_rhs_code (diff) == MINUS_EXPR
>       && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (abs_oprnd)))
>     {
>       *half_type = NULL_TREE;
>       return true;
>     }
> 
> That is, we rely on overflow being undefined, so we need to check
> TYPE_OVERFLOW_UNDEFINED on the type of the subtraction (rather than
> abs_type, which is the type of ABS input, and at this point can be
> different from TREE_TYPE (abs_oprnd)).

I found that doing this alone would get rid of cases which otherwise
should have gone through so I added an extra step such that if this
part fails we'll try to find the unpromoted diff operands and then
try the type overflow check on the types of the unpromoted operands.

Patch is in the next response.

  reply	other threads:[~2023-06-08 10:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09 16:07 Oluwatamilore Adebayo
2023-05-10  9:01 ` Richard Sandiford
2023-05-10  9:49   ` Richard Biener
2023-05-10  9:51     ` Richard Biener
2023-05-10 15:27       ` Richard Sandiford
2023-05-17 12:21         ` oluwatamilore.adebayo
2023-05-18  8:39           ` [PATCH 1/4] " Oluwatamilore.Adebayo
2023-05-18 17:59             ` Richard Sandiford
2023-05-22 13:32               ` Richard Biener
2023-05-23 14:27               ` [PATCH] vect: " Oluwatamilore Adebayo
2023-05-23 14:34                 ` [PATCH 1/2] " Oluwatamilore Adebayo
2023-05-24  9:48                   ` Richard Sandiford
2023-06-06  9:50                     ` [PATCH] vect: " Oluwatamilore Adebayo
2023-06-06  9:53                       ` [PATCH 1/2] " Oluwatamilore Adebayo
2023-06-06 12:56                         ` Richard Sandiford
2023-06-06 14:34                           ` Oluwatamilore Adebayo
2023-06-08 10:28                             ` Oluwatamilore Adebayo [this message]
2023-06-08 10:31                               ` Oluwatamilore Adebayo
2023-06-13  8:26                                 ` Oluwatamilore Adebayo
2023-06-14 11:15                                   ` Richard Sandiford
2023-06-14 15:26                                     ` Oluwatamilore Adebayo
2023-06-15  6:38                                       ` Richard Sandiford
2023-05-10 13:29     ` [PATCH] vect: " Oluwatamilore Adebayo
2023-05-15 12:35       ` Oluwatamilore Adebayo
  -- strict thread matches above, loose matches on Subject: below --
2023-05-09 16:00 Oluwatamilore Adebayo

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=20230608102830.23565-1-oluwatamilore.adebayo@arm.com \
    --to=oluwatamilore.adebayo@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=richard.sandiford@arm.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).