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/111972] [14 regression] missed vectorzation for bool a = j != 1; j = (long int)a; Date: Mon, 11 Dec 2023 15:56:42 +0000 [thread overview] Message-ID: <bug-111972-4-vL2iws7P1c@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-111972-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111972 --- Comment #18 from GCC 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:85c5efcffed19ca6160eeecc2d4faebd9fee63aa commit r14-6420-g85c5efcffed19ca6160eeecc2d4faebd9fee63aa Author: Andrew Pinski <quic_apinski@quicinc.com> Date: Sat Nov 11 15:54:10 2023 -0800 MATCH: (convert)(zero_one !=/== 0/1) for outer type and zero_one type are the same When I moved two_value to match.pd, I removed the check for the {0,+-1} as I had placed it after the {0,+-1} case for cond in match.pd. In the case of {0,+-1} and non boolean, before we would optmize those case to just `(convert)a` but after we would get `(convert)(a != 0)` which was not handled anyways to just `(convert)a`. So this adds a pattern to match `(convert)(zeroone != 0)` and simplify to `(convert)zeroone`. Also this optimizes (convert)(zeroone == 0) into (zeroone^1) if the type match. Removing the opposite transformation from fold. The opposite transformation was added with https://gcc.gnu.org/pipermail/gcc-patches/2006-February/190514.html It is no longer considered the canonicalization either, even VRP will transform it back into `(~a) & 1` so removing it is a good idea. Note the testcase pr69270.c needed a slight update due to not matching exactly a scan pattern, this update makes it more robust and will match before and afterwards and if there are other changes in this area too. Note the testcase gcc.target/i386/pr110790-2.c needs a slight update for better code generation in LP64 bit mode. Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR tree-optimization/111972 PR tree-optimization/110637 * match.pd (`(convert)(zeroone !=/== CST)`): Match and simplify to ((convert)zeroone){,^1}. * fold-const.cc (fold_binary_loc): Remove transformation of `(~a) & 1` and `(a ^ 1) & 1` into `(convert)(a == 0)`. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr110637-1.c: New test. * gcc.dg/tree-ssa/pr110637-2.c: New test. * gcc.dg/tree-ssa/pr110637-3.c: New test. * gcc.dg/tree-ssa/pr111972-1.c: New test. * gcc.dg/tree-ssa/pr69270.c: Update testcase. * gcc.target/i386/pr110790-2.c: Update testcase. * gcc.dg/fold-even-1.c: Removed. Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
next prev parent reply other threads:[~2023-12-11 15:56 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-25 8:14 [Bug middle-end/111972] New: " crazylht at gmail dot com 2023-10-25 9:29 ` [Bug tree-optimization/111972] " crazylht at gmail dot com 2023-10-25 16:46 ` pinskia at gcc dot gnu.org 2023-10-27 3:48 ` pinskia at gcc dot gnu.org 2023-10-27 3:59 ` pinskia at gcc dot gnu.org 2023-10-27 4:01 ` pinskia at gcc dot gnu.org 2023-10-27 5:08 ` crazylht at gmail dot com 2023-10-27 5:17 ` crazylht at gmail dot com 2023-10-27 6:08 ` pinskia at gcc dot gnu.org 2023-10-27 6:11 ` pinskia at gcc dot gnu.org 2023-10-27 12:38 ` rguenth at gcc dot gnu.org 2023-11-14 1:28 ` cvs-commit at gcc dot gnu.org 2023-11-21 1:00 ` liuhongt at gcc dot gnu.org 2023-11-21 1:12 ` pinskia at gcc dot gnu.org 2023-11-21 2:48 ` liuhongt at gcc dot gnu.org 2023-12-02 6:38 ` pinskia at gcc dot gnu.org 2023-12-04 17:31 ` cvs-commit at gcc dot gnu.org 2023-12-10 20:04 ` pinskia at gcc dot gnu.org 2023-12-11 15:56 ` cvs-commit at gcc dot gnu.org [this message] 2023-12-11 15:57 ` pinskia at gcc dot gnu.org 2023-12-12 2:58 ` liuhongt 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-111972-4-vL2iws7P1c@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).