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 middle-end/79173] add-with-carry and subtract-with-borrow support (x86_64 and others)
Date: Tue, 20 Jun 2023 18:18:24 +0000	[thread overview]
Message-ID: <bug-79173-4-PtesUscVVR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-79173-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #25 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

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

commit r14-2001-gf8f68c4ca622a24c2e8cf2b5f2f9fdcd47a7b369
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Jun 20 20:17:41 2023 +0200

    tree-ssa-math-opts: Small uaddc/usubc pattern matching improvement
[PR79173]

    In the following testcase we fail to pattern recognize the least
significant
    .UADDC call.  The reason is that arg3 in that case is
      _3 = .ADD_OVERFLOW (...);
      _2 = __imag__ _3;
      _1 = _2 != 0;
      arg3 = (unsigned long) _1;
    and while before the changes arg3 has a single use in some .ADD_OVERFLOW
    later on, we add a .UADDC call next to it (and gsi_remove/gsi_replace only
    what is strictly necessary and leave quite a few dead stmts around which
    next DCE cleans up) and so it all of sudden isn't used just once, but twice
    (.ADD_OVERFLOW and .UADDC) and so uaddc_cast fails.  While we could tweak
    uaddc_cast and not require has_single_use in these uses, there is also
    no vrp that would figure out that because __imag__ _3 is in [0, 1] range,
    it can just use arg3 = __imag__ _3; and drop the comparison and cast.

    We already search if either arg2 or arg3 is ultimately set from __imag__
    of .{{ADD,SUB}_OVERFLOW,U{ADD,SUB}C} call, so the following patch just
    remembers the lhs of __imag__ from that case and uses it later.

    2023-06-20  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/79173
            * tree-ssa-math-opts.cc (match_uaddc_usubc): Remember lhs of
            IMAGPART_EXPR of arg2/arg3 and use that as arg3 if it has the right
            type.

            * g++.target/i386/pr79173-1.C: New test.

  parent reply	other threads:[~2023-06-20 18:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-79173-4@http.gcc.gnu.org/bugzilla/>
2020-11-15 21:21 ` [Bug target/79173] " already5chosen at yahoo dot com
2020-11-15 21:24 ` already5chosen at yahoo dot com
2020-11-15 21:32 ` jakub at gcc dot gnu.org
2020-11-15 22:30 ` already5chosen at yahoo dot com
2020-11-15 22:45 ` already5chosen at yahoo dot com
2021-05-28 15:34 ` tkoenig at gcc dot gnu.org
2021-09-09  6:48 ` [Bug middle-end/79173] " pinskia at gcc dot gnu.org
2021-09-09  8:54 ` vincent-gcc at vinc17 dot net
2021-09-09  9:05 ` pinskia at gcc dot gnu.org
2023-06-05  7:17 ` jakub at gcc dot gnu.org
2023-06-05 13:01 ` chfast at gmail dot com
2023-06-06 12:01 ` jakub at gcc dot gnu.org
2023-06-06 16:12 ` jakub at gcc dot gnu.org
2023-06-15  7:07 ` cvs-commit at gcc dot gnu.org
2023-06-15  7:10 ` cvs-commit at gcc dot gnu.org
2023-06-15  7:16 ` cvs-commit at gcc dot gnu.org
2023-06-15  7:49 ` jakub at gcc dot gnu.org
2023-06-16 17:49 ` cvs-commit at gcc dot gnu.org
2023-06-17 15:37 ` law at gcc dot gnu.org
2023-06-17 16:34 ` jakub at gcc dot gnu.org
2023-06-20 18:18 ` cvs-commit at gcc dot gnu.org [this message]
2023-06-24  9:42 ` glisse at gcc dot gnu.org
2023-06-24  9:51 ` jakub at gcc dot gnu.org
2023-06-24 12:09 ` vincent-gcc at vinc17 dot net
2023-06-24 12:32 ` jakub at gcc dot gnu.org
2023-06-24 13:10 ` vincent-gcc at vinc17 dot net
2023-06-24 13:14 ` jakub at gcc dot gnu.org
2023-06-25  0:22 ` vincent-gcc at vinc17 dot net
2023-08-29  8:47 ` cvs-commit at gcc dot gnu.org

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-79173-4-PtesUscVVR@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).