public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "liuhongt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/114591] [12/13/14 Regression] register allocators introduce an extra load operation since gcc-12
Date: Thu, 11 Apr 2024 07:28:16 +0000	[thread overview]
Message-ID: <bug-114591-4-aBnvgxGPQl@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114591-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114591

--- Comment #15 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
> I don't see this as problematic. IIRC, there was a discussion in the past
> that a couple (two?) memory accesses from the same location close to each
> other can be faster (so, -O2, not -Os) than preloading the value to the
> register first.
At lease for memory with vector mode, it's better to preload the value to
register first.
> 
> In contrast, the example from the Comment #11 already has the correct value
> in %eax, so there is no need to reload it again from memory, even in a
> narrower mode.

So the problem is why cse can't handle same memory with narrower mode, maybe
it's because there's zero_extend in the first load. cse looks like can handle
simple wider mode memory.

4952      /* See if a MEM has already been loaded with a widening operation;
4953         if it has, we can use a subreg of that.  Many CISC machines
4954         also have such operations, but this is only likely to be
4955         beneficial on these machines.  */

  parent reply	other threads:[~2024-04-11  7:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 18:57 [Bug rtl-optimization/114591] New: rtl-reload " absoler at smail dot nju.edu.cn
2024-04-04 19:03 ` [Bug target/114591] " pinskia at gcc dot gnu.org
2024-04-04 19:07 ` [Bug target/114591] [12/13/14 Regression] " pinskia at gcc dot gnu.org
2024-04-05  2:32 ` [Bug target/114591] [12/13/14 Regression] register allocators " law at gcc dot gnu.org
2024-04-08 15:02 ` jakub at gcc dot gnu.org
2024-04-10  7:51 ` ubizjak at gmail dot com
2024-04-10  8:17 ` liuhongt at gcc dot gnu.org
2024-04-10  8:30 ` liuhongt at gcc dot gnu.org
2024-04-10  8:36 ` ubizjak at gmail dot com
2024-04-10  8:40 ` ubizjak at gmail dot com
2024-04-10  8:47 ` ubizjak at gmail dot com
2024-04-10  8:52 ` liuhongt at gcc dot gnu.org
2024-04-10  9:07 ` ubizjak at gmail dot com
2024-04-10  9:12 ` liuhongt at gcc dot gnu.org
2024-04-11  6:33 ` liuhongt at gcc dot gnu.org
2024-04-11  6:54 ` ubizjak at gmail dot com
2024-04-11  7:08 ` pinskia at gcc dot gnu.org
2024-04-11  7:28 ` liuhongt at gcc dot gnu.org [this message]
2024-04-11  7:37 ` 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-114591-4-aBnvgxGPQl@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: link
Be 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).