This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate


On 2014-10-22 11:29 PM, Maxim Kuvyrkov wrote:
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.


Ok, then. It was a temporary intermediate stage very long ago. But temporary solutions become permanent ones. I don't think I'll find a time to work on implementing such feature (differentiating lookahead for cold/hot BBs).

The patch is ok without my previous request.

Thanks, Maxim.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]