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/100864] (a&!b) | b is not opimized to a | b for comparisons Date: Mon, 31 Jul 2023 17:12:33 +0000 [thread overview] Message-ID: <bug-100864-4-BKvdBDJ7n1@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100864-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100864 --- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>: https://gcc.gnu.org/g:b9237226fdc9387bccf584a811b30c5d3689ffd2 commit r14-2885-gb9237226fdc9387bccf584a811b30c5d3689ffd2 Author: Andrew Pinski <apinski@marvell.com> Date: Fri Jul 28 20:27:03 2023 -0700 tree-optimization: [PR100864] `(a&!b) | b` is not opimized to `a | b` for comparisons This is a new version of the patch. Instead of doing the matching of inversion comparison directly inside match, creating a new function (bitwise_inverted_equal_p) to do it. It is very similar to bitwise_equal_p that was added in r14-2751-g2a3556376c69a1fb but instead it says `expr1 == ~expr2`. A follow on patch, will use this function in other patterns where we try to match `@0` and `(bit_not @0)`. Changed the name bitwise_not_equal_p to bitwise_inverted_equal_p. Committed as approved after a Bootstrapped and test on x86_64-linux-gnu with no regressions. PR tree-optimization/100864 gcc/ChangeLog: * generic-match-head.cc (bitwise_inverted_equal_p): New function. * gimple-match-head.cc (bitwise_inverted_equal_p): New macro. (gimple_bitwise_inverted_equal_p): New function. * match.pd ((~x | y) & x): Use bitwise_inverted_equal_p instead of direct matching bit_not. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/bitops-3.c: New test.
next prev parent reply other threads:[~2023-07-31 17:12 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-01 23:48 [Bug tree-optimization/100864] New: (a&!b) | b is not opimized to a | b for conditionals pinskia at gcc dot gnu.org 2021-06-02 1:33 ` [Bug tree-optimization/100864] (a&!b) | b is not opimized to a | b for comparisons pinskia at gcc dot gnu.org 2021-06-02 2:05 ` pinskia at gcc dot gnu.org 2021-06-02 8:09 ` rguenth at gcc dot gnu.org 2021-06-05 1:21 ` pinskia at gcc dot gnu.org 2021-06-14 22:04 ` pinskia at gcc dot gnu.org 2023-05-24 0:09 ` pinskia at gcc dot gnu.org 2023-07-22 23:28 ` pinskia at gcc dot gnu.org 2023-07-29 19:10 ` pinskia at gcc dot gnu.org 2023-07-31 17:12 ` cvs-commit at gcc dot gnu.org [this message] 2023-07-31 17:14 ` 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-100864-4-BKvdBDJ7n1@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).