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 rtl-optimization/98334] Failure to optimally optimize add loop to mul Date: Tue, 05 Jan 2021 09:59:11 +0000 [thread overview] Message-ID: <bug-98334-4-n2934Szk72@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-98334-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98334 --- Comment #4 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:4615cde5d7ef281d4b554df411f82ad707f0a54d commit r11-6456-g4615cde5d7ef281d4b554df411f82ad707f0a54d Author: Jakub Jelinek <jakub@redhat.com> Date: Tue Jan 5 10:57:52 2021 +0100 simplify-rtx: Optimize (x - 1) * y + y [PR98334] We don't try to optimize for signed x, y (int) (x - 1U) * y + y into x * y, we can't do that with signed x * y, because the former is well defined for INT_MIN and -1, while the latter is not. We could perhaps optimize it during isel or some very late optimization where we'd turn magically flag_wrapv, but we don't do that yet. This patch optimizes it in simplify-rtx.c, such that we can optimize it during combine. 2021-01-05 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/98334 * simplify-rtx.c (simplify_context::simplify_binary_operation_1): Optimize (X - 1) * Y + Y to X * Y or (X + 1) * Y - Y to X * Y. * gcc.target/i386/pr98334.c: New test.
next prev parent reply other threads:[~2021-01-05 9:59 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-16 18:48 [Bug tree-optimization/98334] New: " gabravier at gmail dot com 2020-12-17 10:04 ` [Bug tree-optimization/98334] " jakub at gcc dot gnu.org 2020-12-17 10:59 ` [Bug rtl-optimization/98334] " jakub at gcc dot gnu.org 2021-01-04 15:36 ` rguenth at gcc dot gnu.org 2021-01-05 9:59 ` cvs-commit at gcc dot gnu.org [this message] 2021-01-05 10:01 ` jakub at gcc dot gnu.org 2022-05-27 20:34 ` roger at nextmovesoftware dot com 2023-02-17 18:35 ` pinskia 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-98334-4-n2934Szk72@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: linkBe 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).