public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108938] Missing bswap detection Date: Thu, 09 Mar 2023 02:21:28 +0000 [thread overview] Message-ID: <bug-108938-4-QQTScVxwEf@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108938-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108938 --- Comment #14 from Hongtao.liu <crazylht at gmail dot com> --- Got 1 performance opportunity in GCC itself with bswap + bit_and + rotate, the Intermediate value are all single-use which can be DCEd. Got 4 performance opportunity in SPEC2017. bswap + bit_and + rotate + single_use: 1 bswap + rotate + single_use: 1 bswap + rotate + not single_use: 2. For 2 not single use, the tectase is like foo1 (char* a, unsigned int* __restrict b) { a[0] = b[0] >> 24; a[1] = b[0] >> 16; a[2] = b[0] >> 8; a[3] = b[0]; a[4] = b[1] >> 24; a[5] = b[1] >> 16; a[6] = b[1] >> 8; a[7] = b[1]; } b[0] is used by multi stmt for shift, but no other places, so it actually can be DECd. So for GCC itself and SPEC2017 with -O2, bswap + bit_and + rotate optimization won't cause extra stmts.
next prev parent reply other threads:[~2023-03-09 2:21 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-27 2:51 [Bug target/108938] New: " crazylht at gmail dot com 2023-02-27 8:11 ` [Bug target/108938] " jakub at gcc dot gnu.org 2023-02-27 8:39 ` crazylht at gmail dot com 2023-02-27 9:01 ` jakub at gcc dot gnu.org 2023-02-27 9:40 ` jakub at gcc dot gnu.org 2023-03-06 9:52 ` crazylht at gmail dot com 2023-03-06 9:56 ` jakub at gcc dot gnu.org 2023-03-06 9:57 ` crazylht at gmail dot com 2023-03-06 10:05 ` crazylht at gmail dot com 2023-03-06 10:09 ` jakub at gcc dot gnu.org 2023-03-06 10:41 ` rguenth at gcc dot gnu.org 2023-03-07 2:52 ` crazylht at gmail dot com 2023-03-07 8:40 ` jakub at gcc dot gnu.org 2023-03-07 8:53 ` crazylht at gmail dot com 2023-03-09 2:21 ` crazylht at gmail dot com [this message] 2023-03-09 5:50 ` crazylht at gmail dot com 2023-03-10 17:54 ` pinskia at gcc dot gnu.org 2023-05-30 9:54 ` cvs-commit at gcc dot gnu.org 2023-05-30 23:19 ` crazylht at gmail dot com
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-108938-4-QQTScVxwEf@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).