public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: liuhongt <hongtao.liu@intel.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Add a bit dislike for separate mem alternative when op is REG_P.
Date: Fri, 27 May 2022 12:39:09 +0300 (MSK)	[thread overview]
Message-ID: <61cfc852-ed8e-1653-e94e-df5de7b3fc6f@ispras.ru> (raw)
In-Reply-To: <20220525033920.77449-1-hongtao.liu@intel.com>

On Wed, 25 May 2022, liuhongt via Gcc-patches 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.

In the PR, the spill happens in the initial basic block of the function, i.e.
the one with the highest frequency.

Also as noted in the PR, swapping the 'unlikely' branch to 'likely' avoids
the spill, even though it does not affect the frequency of the initial basic
block, and makes the block with the use more rarely executed.

Do you have a root cause analysis that explains the above?

Alexander

  parent reply	other threads:[~2022-05-27  9:39 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
2022-05-31 23:51         ` Hongtao Liu
2022-05-27  9:39 ` Alexander Monakov [this message]
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=61cfc852-ed8e-1653-e94e-df5de7b3fc6f@ispras.ru \
    --to=amonakov@ispras.ru \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.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).