public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61747] min,max pattern not always properly optimized (for sse4 targets)
Date: Thu, 20 Jul 2023 07:51:29 +0000	[thread overview]
Message-ID: <bug-61747-4-dvfGOH6Tvs@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61747-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61747

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:ceae1400cf24f329393e96dd9720b0391afe858d

commit r14-2667-gceae1400cf24f329393e96dd9720b0391afe858d
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jul 18 13:19:11 2023 +0200

    middle-end/61747 - conditional move expansion and constants

    When expanding a COND_EXPR or a VEC_COND_EXPR the x86 backend for
    example tries to match FP min/max instructions.  But this only
    works when it can see the equality of the comparison and selected
    operands.  This breaks in both prepare_cmp_insn and vector_compare_rtx
    where the former forces expensive constants to a register and the
    latter performs legitimization.  The patch below fixes this in
    the caller preserving former equalities.

            PR middle-end/61747
            * internal-fn.cc (expand_vec_cond_optab_fn): When the
            value operands are equal to the original comparison operands
            preserve that equality by re-using the comparison expansion.
            * optabs.cc (emit_conditional_move): When the value operands
            are equal to the comparison operands and would be forced to
            a register by prepare_cmp_insn do so earlier, preserving the
            equality.

            * g++.target/i386/pr61747.C: New testcase.

  parent reply	other threads:[~2023-07-20  7:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 13:34 [Bug tree-optimization/61747] New: " vincenzo.innocente at cern dot ch
2014-07-08 14:57 ` [Bug tree-optimization/61747] " glisse at gcc dot gnu.org
2014-07-08 15:21 ` vincenzo.innocente at cern dot ch
2014-07-08 15:27 ` glisse at gcc dot gnu.org
2014-07-08 15:35 ` vincenzo.innocente at cern dot ch
2014-07-08 15:46 ` rguenth at gcc dot gnu.org
2021-12-13  0:13 ` pinskia at gcc dot gnu.org
2023-07-18 11:15 ` rguenth at gcc dot gnu.org
2023-07-20  7:51 ` cvs-commit at gcc dot gnu.org [this message]
2023-07-20  7:52 ` rguenth at gcc dot gnu.org
2023-07-21  5:37 ` pinskia at gcc dot gnu.org
2023-07-21  6:21 ` rguenther at suse dot de

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=bug-61747-4-dvfGOH6Tvs@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).