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>,
	"hernandez, aldy" <aldyh@redhat.com>
Subject: Re: [PATCH] PR tree-optimization/107985 - Ensure arguments to range-op handler are supported.
Date: Wed, 7 Dec 2022 18:26:27 +0100	[thread overview]
Message-ID: <CAFiYyc2pEOfVMuAV1POYekTCQXj3R2RE7HiPBYVO_xRe68=JXQ@mail.gmail.com> (raw)
In-Reply-To: <1752ce19-956b-a055-2585-a6b0e2827572@redhat.com>

On Wed, Dec 7, 2022 at 5:45 PM Andrew MacLeod via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> THis patch invalidates a range-op handler object if an operand type in
> the statement is not supported.
>
> This also triggered a check in stmt dependency resolution which assumed
> there must be a valid handler for any stmt with an appropriate LHS
> type... which is a false assumption.
>
> This should do for now, but long term I will rework the dispatch code to
> ensure it matches the specifically supported patterns of operands. This
> will make the handler creation a little slower, but speed up the actual
> dispatch, especially as we add new range types next release.  Its also
> much more invasive... too much for this release I think.
>
> bootstraps on x86_64-pc-linux-gnu with no regressions.  OK?

+         if (!Value_Range::supports_type_p (TREE_TYPE (m_op1)) ||
+             !Value_Range::supports_type_p (TREE_TYPE (m_op2)))

The ||s go to the next line.  Since in a GIMPLE_COND both operand types
are compatible it's enough to check one of them.

Likewise for the GIMPLE_ASSIGN case I think - I don't know of any
binary operator that has operands that would not be both compatible
or not compatible (but it's less clear-cut here).

Otherwise looks straight forward.

Thanks,
Richard.

> Andrew
>

  reply	other threads:[~2022-12-07 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 16:44 Andrew MacLeod
2022-12-07 17:26 ` Richard Biener [this message]
2022-12-08 13:53   ` 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='CAFiYyc2pEOfVMuAV1POYekTCQXj3R2RE7HiPBYVO_xRe68=JXQ@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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).