public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Andrew MacLeod <amacleod@redhat.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Jakub Jelinek <jakub@redhat.com>,
	 "hernandez, aldy" <aldyh@redhat.com>
Subject: Re: [PATCH] PR tree-optimization/108447 - Do not try to logical fold floating point relations.
Date: Thu, 26 Jan 2023 08:13:31 +0100	[thread overview]
Message-ID: <CAFiYyc1BuS-ryqfitsXLyk42rPC8gtZKTwcZW_Z9Cv4mHoazyg@mail.gmail.com> (raw)
In-Reply-To: <CAFiYyc3KjS+71yitX4trwq_wE4ATrf-+1mzZbNfAh3HJzeUxeA@mail.gmail.com>

On Thu, Jan 26, 2023 at 8:09 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On Wed, Jan 25, 2023 at 7:05 PM Andrew MacLeod <amacleod@redhat.com> wrote:
> >
> > This boils down to a single place where we are trying to do things with
> > relations in ranger that are simply not safe when we need to honor NANs.
> >
> > I think we can avoid all the other shuffling of relations, and simply
> > not perform this optimization when it comes to floats.
> >
> > The case the routine handles is:
> >
> > c_2 = a_6 > b_7
> > c_3 = a_6 < b_7
> > c_4 = c_2 && c_3
> >
> > c_2 and c_3 can never be true at the same time, Therefore c_4 can always
> > resolve to false based purely on the relations.
> >
> >
> > Range-ops is unable to do this optimization directly as it requires
> > examining things from outside the statement, and is not easily
> > communicated a simple relation to operator_logical_and.
> >
> > This routine proceeds to look at the definitions of c_2 and c_3, tries
> > to determine if there are common operands, and queries for any relations
> > between them.   If it turns out there is something, depending on whether
> > its && or || , we use intersection or union to determine if the result
> > of the logical operation can be folded.  If HONOR_NANS is true for the
> > float type, then we cannot do this optimization, and bail early.
> >
> > At this point I do not think we need to do any of the other things
> > proposed to relations, so we don't need either of the other 2 patches
> > this release.
> >
> > Bootstraps on x86_64-pc-linux-gnu with no regressions.  OK for trunk?
>
> +  if (HONOR_NANS (TREE_TYPE (ssa1_dep1)))
> +    return;
>
> would that rather be !(range-includes-nan (ssa1_dep1) ||
> range-includes-nan (ssa1_dep2) || ..)?

Saw the discussion in the other thread only now, so OK.

> That said, if the other 2 patches fix some latent issues in the new
> frange code I'd
> rather have them fixed.

So do we know bugs in the current code?  You said some buggy
function isn't used, so better delete it.  Are there other latent issues?

Thanks,
Richard.

> Richard.
>
> >
> > Andrew

  reply	other threads:[~2023-01-26  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 18:05 Andrew MacLeod
2023-01-26  7:09 ` Richard Biener
2023-01-26  7:13   ` Richard Biener [this message]
2023-01-26 14:24     ` Andrew MacLeod

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=CAFiYyc1BuS-ryqfitsXLyk42rPC8gtZKTwcZW_Z9Cv4mHoazyg@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@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).