public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "wilco at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/93565] [11/12/13 Regression] Combine duplicates instructions Date: Wed, 03 Apr 2024 16:13:12 +0000 [thread overview] Message-ID: <bug-93565-4-GktrvS6zuX@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-93565-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93565 --- Comment #31 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #29) > Looking back at this one, I (In reply to Wilco from comment #8) > > Here is a much simpler example: > > > > void f (int *p, int y) > > { > > int a = y & 14; > > *p = a | p[a]; > > } > After r14-9692-g839bc42772ba7af66af3bd16efed4a69511312ae, we now get: > f: > .LFB0: > .cfi_startproc > and w2, w1, 14 > mov x1, x2 > ldr w2, [x0, x2, lsl 2] > orr w1, w2, w1 > str w1, [x0] > ret > .cfi_endproc > > There is an extra move still but the duplicated and is gone. (with > -frename-registers added, the move is gone as REE is able to remove the zero > extend but then there is a life range conflict so can't remove the move too). Even with the mov it is better since that can be done with zero latency in rename in most CPUs. > So maybe this should be closed as fixed for GCC 14 and the cost changes for > clz reverted. The ctz costs are correct since it is a 2-instruction sequence - it only needs adjusting for CSSC.
prev parent reply other threads:[~2024-04-03 16:13 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-93565-4@http.gcc.gnu.org/bugzilla/> 2020-03-12 11:59 ` [Bug rtl-optimization/93565] [9/10 regression] " jakub at gcc dot gnu.org 2021-06-01 8:16 ` [Bug rtl-optimization/93565] [9/10/11/12 " rguenth at gcc dot gnu.org 2022-05-27 9:41 ` [Bug rtl-optimization/93565] [10/11/12/13 " rguenth at gcc dot gnu.org 2022-06-28 10:39 ` jakub at gcc dot gnu.org 2023-07-07 10:36 ` [Bug rtl-optimization/93565] [11/12/13/14 " rguenth at gcc dot gnu.org 2024-03-27 17:50 ` pinskia at gcc dot gnu.org 2024-03-28 7:02 ` [Bug rtl-optimization/93565] [11/12/13 Regression] " rguenth at gcc dot gnu.org 2024-04-03 16:13 ` wilco at gcc dot gnu.org [this message]
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-93565-4-GktrvS6zuX@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).