From: Richard Sandiford <richard.sandiford@arm.com>
To: Vladimir Makarov via Gcc-patches <gcc-patches@gcc.gnu.org>
Cc: Hongtao Liu <crazylht@gmail.com>,
Vladimir Makarov <vmakarov@redhat.com>,
liuhongt <hongtao.liu@intel.com>
Subject: Re: [PATCH] Add a bit dislike for separate mem alternative when op is REG_P.
Date: Tue, 31 May 2022 17:40:27 +0100 [thread overview]
Message-ID: <mptleuhmz9g.fsf@arm.com> (raw)
In-Reply-To: <675684ae-6b28-2cc9-d582-7b5e507d70d5@redhat.com> (Vladimir Makarov via Gcc-patches's message of "Tue, 31 May 2022 12:28:12 -0400")
Vladimir Makarov via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> On 2022-05-29 23:05, Hongtao Liu wrote:
>> On Fri, May 27, 2022 at 5:12 AM Vladimir Makarov via Gcc-patches
>> <gcc-patches@gcc.gnu.org> wrote:
>>>
>>> On 2022-05-24 23:39, liuhongt wrote:
>>>> Rigt now, mem_cost for separate mem alternative is 1 * frequency which
>>>> is pretty small and caused the unnecessary SSE spill in the PR, I've tried
>>>> to rework backend cost model, but RA still not happy with that(regress
>>>> somewhere else). I think the root cause of this is cost for separate 'm'
>>>> alternative cost is too small, especially considering that the mov cost
>>>> of gpr are 2(default for REGISTER_MOVE_COST). So this patch increase mem_cost
>>>> to 2*frequency, also increase 1 for reg_class cost when m alternative.
>>>>
>>>>
>>>> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
>>>> Ok for trunk?
>>> Thank you for addressing this problem. And sorry I can not approve this
>>> patch at least w/o your additional work on benchmarking this change.
>>>
>>> This code is very old. It is coming from older RA (former file
>>> regclass.c) and existed practically since GCC day 1. People tried many
>>> times to improve this code. The code also affects many targets.
>> Yes, that's why I increased it as low as possible, so it won't regress
>> #c6 in the PR.
>>> I can approve this patch if you show that there is no regression at
>>> least on x86-64 on some credible benchmark, e.g. SPEC2006 or SPEC2017.
>>>
>> I've tested the patch for SPEC2017 with both -march=cascadelake
>> -Ofast -flto and -O2 -mtune=generic.
>> No obvious regression is observed, the binaries are all different from
>> before, so I looked at 2 of them, the difference mainly comes from
>> different choices of registers(xmm13 -> xmm12).
>> Ok for trunk then?
>
> OK.
>
> Thank you for checking SPEC2017.
>
> I hope it will not create troubles for other targets.
Can we hold off for a bit? Like Alexander says, there seem to be
some inconsistencies in the target patterns, so I think we should
first rule out any changes being needed there.
Thanks,
Richard
next prev parent reply other threads:[~2022-05-31 16:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 3:39 liuhongt
2022-05-25 5:17 ` Hongtao Liu
2022-05-26 21:12 ` Vladimir Makarov
2022-05-30 3:05 ` Hongtao Liu
2022-05-31 16:28 ` Vladimir Makarov
2022-05-31 16:40 ` Richard Sandiford [this message]
2022-05-31 23:51 ` Hongtao Liu
2022-05-27 9:39 ` Alexander Monakov
2022-05-30 2:52 ` Liu, Hongtao
2022-05-30 6:22 ` Alexander Monakov
2022-05-30 7:14 ` Hongtao Liu
2022-05-30 7:44 ` Alexander Monakov
2022-05-30 8:34 ` Hongtao Liu
2022-05-30 9:41 ` Alexander Monakov
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=mptleuhmz9g.fsf@arm.com \
--to=richard.sandiford@arm.com \
--cc=crazylht@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hongtao.liu@intel.com \
--cc=vmakarov@redhat.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).