public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Andrew Pinski <pinskia@gmail.com>
Subject: Re: [PATCH] PR tree-optimization/92342: Optimize b & -(a==c) in match.pd
Date: Thu, 12 Jan 2023 14:10:47 +0100	[thread overview]
Message-ID: <CAFiYyc0tEoisUAzyXVaUEkog9NR7ymMocjvrNzffwfKn6t2ZMA@mail.gmail.com> (raw)
In-Reply-To: <009101d91f75$ac187920$04496b60$@nextmovesoftware.com>

On Tue, Jan 3, 2023 at 2:17 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This patch is an update/tweak of Andrew Pinski's two patches for
> PR tree-optimization/92342, that were originally posted back in November:
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585111.html
> https://gcc.gnu.org/pipermail/gcc-patches/2021-November/585112.html
>
> Technically, the first of those was approved by Richard Biener, though
> never committed, and my first thought was to simply push it for Andrew,
> but the review of the second piece expressed concerns over comparisons
> in non-integral modes, where the result may not be zero-one valued.
> Indeed both transformations misbehave in the presence of vector mode
> comparisons (these transformations are already implemented for
> vec_cond elsewhere in match.pd), so my minor contribution is to limit
> these new transformations to scalars, by testing that both the operands
> and results are INTEGRAL_TYPE_P.
>
> This patch has been tested on x86_64-pc-linux-gnu with make bootstrap
> and make -k check, both with and without --target_board=unix{-m32},
> with no new failures.  Ok for mainline?

OK.

Thanks,
Richard.

>
> 2023-01-03  Andrew Pinski  <apinski@marvell.com>
>             Roger Sayle  <roger@nextmovesoftware.com>
>
> gcc/ChangeLog:
>         PR tree-optimization/92342
>         * match.pd ((m1 CMP m2) * d -> (m1 CMP m2) ? d : 0):
>         Use tcc_comparison and :c for the multiply.
>         (b & -(a CMP c) -> (a CMP c)?b:0): New pattern.
>
> gcc/testsuite/ChangeLog:
>         PR tree-optimization/92342
>         * gcc.dg/tree-ssa/andnegcmp-1.c: New test.
>         * gcc.dg/tree-ssa/andnegcmp-2.c: New test.
>         * gcc.dg/tree-ssa/multcmp-1.c: New test.
>         * gcc.dg/tree-ssa/multcmp-1.c: New test.
>
>
> Thanks in advance (and thanks to Andrew).
> Roger
> --
>

      reply	other threads:[~2023-01-12 13:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-03 13:17 Roger Sayle
2023-01-12 13:10 ` Richard Biener [this message]

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=CAFiYyc0tEoisUAzyXVaUEkog9NR7ymMocjvrNzffwfKn6t2ZMA@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gmail.com \
    --cc=roger@nextmovesoftware.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).