public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
To: Vladimir Makarov <vmakarov@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate
Date: Thu, 23 Oct 2014 03:34:00 -0000	[thread overview]
Message-ID: <EC2E73E6-F25D-4039-9BFF-A46EA05289C4@linaro.org> (raw)
In-Reply-To: <5446815C.6050609@redhat.com>

On Oct 22, 2014, at 4:53 AM, Vladimir Makarov <vmakarov@redhat.com> wrote:

> On 10/20/2014 11:16 PM, Maxim Kuvyrkov wrote:
>> Hi,
>> 
>> This patch cleans up (removes) cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate.
>> 
>> These seem to be an artifact from the scheduler refactoring 10+ years ago.  They assume that dfa_lookahead and issue_rate can change mid-way through scheduling, which is never the case.  All backends currently treat dfa_lookahead and issue_rate as constants for the duration of scheduling passes.
>> 
>> Bootstrapped on x86_64-linux-gnu.  Regression testing is in progress.  OK to commit if no regressions?
>> 
> Yes.  the patch for issue rate itself is ok but you should have modified
> doc/tm.texi too for dfa lookahead hook saying that it should be a
> constant (issue rate already has such clause).
> 
> On the other hand I'd not assume that dfa look ahead is a constant.  In
> future we could make it non-constant to differentiate non-hot and hot
> functions to speed up the scheduler as dfa look ahead scheduling is
> pretty expensive.
> 
> So issue rate change is ok but I'd not rush to change dfa look ahead
> related code.

It is trivial to prove that currently cached_first_cycle_multipass_dfa_lookahead always has the same value as dfa_lookahead.  And, even should targetm.sched.first_cycle_multipass_dfa_lookahead start returning different values, max_issue will happily continue to use the value that the hook returned in sched_init().

Also, your suggestion to use different dfa_lookahead values for hot/cold functions is not affected by this patch.  The values of dfa_lookahead variable have scope of the scheduling pass, which is invoked separately for every function.

I guess, you could, potentially, start differentiating values of dfa_lookahead based on whether a basic_block is hot or cold, but handling this scenario would require significant changes throughout the scheduler.

To summarize, dfa_lookahead is currently a pass-time invariant, that is free to change between invocations of the scheduler pass.  Cached_first_cycle_multipass_dfa_lookahead always holds the same value as dfa_lookahead, and, as such, is extraneous.

Thank you,

--
Maxim Kuvyrkov
www.linaro.org



  reply	other threads:[~2014-10-23  3:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21  3:21 Maxim Kuvyrkov
2014-10-21 15:53 ` Vladimir Makarov
2014-10-23  3:34   ` Maxim Kuvyrkov [this message]
2014-10-24  3:21     ` Vladimir Makarov

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=EC2E73E6-F25D-4039-9BFF-A46EA05289C4@linaro.org \
    --to=maxim.kuvyrkov@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --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).