public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Jivan Hakobyan <jivanhakobyan9@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: RISC-V: Folding memory for FP + constant case
Date: Tue, 25 Jul 2023 21:31:42 -0600	[thread overview]
Message-ID: <61c9b9c2-f52e-2b4e-6d02-62c991603c39@gmail.com> (raw)
In-Reply-To: <CAHso6sPJvjWgaJrpG0SunEM6-TOmV5_Tzznk3gr9tFWuHBd7-Q@mail.gmail.com>



On 7/25/23 05:24, Jivan Hakobyan wrote:
> Hi.
> 
> I re-run the benchmarks and hopefully got the same profit.
> I also compared the leela's code and figured out the reason.
> 
> Actually, my and Manolis's patches do the same thing. The difference is 
> only execution order.
But shouldn't your patch also allow for for at the last the potential to 
pull the fp+offset computation out of a loop?  I'm pretty sure Manolis's 
patch can't do that.

> Because of f-m-o held after the register allocation it cannot eliminate 
> redundant move 'sp' to another register.
Actually that's supposed to be handled by a different patch that should 
already be upstream.  Specifically;

> commit 6a2e8dcbbd4bab374b27abea375bf7a921047800
> Author: Manolis Tsamis <manolis.tsamis@vrull.eu>
> Date:   Thu May 25 13:44:41 2023 +0200
> 
>     cprop_hardreg: Enable propagation of the stack pointer if possible
>     
>     Propagation of the stack pointer in cprop_hardreg is currenty
>     forbidden in all cases, due to maybe_mode_change returning NULL.
>     Relax this restriction and allow propagation when no mode change is
>     requested.
>     
>     gcc/ChangeLog:
>     
>             * regcprop.cc (maybe_mode_change): Enable stack pointer
>             propagation.
I think there were a couple-follow-ups.  But that's the key change that 
should allow propagation of copies from the stack pointer and thus 
eliminate the mov gpr,sp instructions.  If that's not happening, then 
it's worth investigating why.

> 
> Besides that, I have checked the build failure on x264_r. It is already 
> fixed on the third version.
Yea, this was a problem with re-recognition.  I think it was fixed by:

> commit ecfa870ff29d979bd2c3d411643b551f2b6915b0
> Author: Vineet Gupta <vineetg@rivosinc.com>
> Date:   Thu Jul 20 11:15:37 2023 -0700
> 
>     RISC-V: optim const DF +0.0 store to mem [PR/110748]
>     
>     Fixes: ef85d150b5963 ("RISC-V: Enable TARGET_SUPPORTS_WIDE_INT")
>     
>     DF +0.0 is bitwise all zeros so int x0 store to mem can be used to optimize it.
[ ... ]


So I think the big question WRT your patch is does it still help the 
case where we weren't pulling the fp+offset computation out of a loop.

Jeff

  reply	other threads:[~2023-07-26  3:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 20:59 Jivan Hakobyan
2023-07-15  6:16 ` Jeff Law
2023-07-25 11:24   ` Jivan Hakobyan
2023-07-26  3:31     ` Jeff Law [this message]
2023-08-01 19:14       ` Vineet Gupta
2023-08-01 20:16         ` Jivan Hakobyan
2023-08-01 21:55         ` Jeff Law
2023-08-01 22:07           ` Philipp Tomsich
2023-08-01 23:03             ` Vineet Gupta
2023-08-01 23:06               ` Philipp Tomsich
2023-08-01 23:13                 ` Vineet Gupta
2023-08-01 23:27                   ` Jeff Law
2023-08-01 23:38                     ` Vineet Gupta
2023-08-01 23:52                       ` Jeff Law
2023-08-04  9:52                         ` Manolis Tsamis
2023-08-04 16:23                           ` Jeff Law
2023-08-05  9:27                             ` Manolis Tsamis
2023-08-01 23:22                 ` Jeff Law
2023-08-01 23:28                   ` Vineet Gupta
2023-08-01 23:21               ` Jeff Law
2023-08-09 19:31 ` Jeff Law

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=61c9b9c2-f52e-2b4e-6d02-62c991603c39@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jivanhakobyan9@gmail.com \
    /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).