This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate
- From: Vladimir Makarov <vmakarov at redhat dot com>
- To: Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Oct 2014 23:17:03 -0400
- Subject: Re: [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate
- Authentication-results: sourceware.org; auth=none
- References: <EF6BB45F-FB61-4134-A9D0-FBF0AD2E70EE at linaro dot org> <5446815C dot 6050609 at redhat dot com> <EC2E73E6-F25D-4039-9BFF-A46EA05289C4 at linaro dot org>
On 2014-10-22 11:29 PM, Maxim Kuvyrkov wrote:
On Oct 22, 2014, at 4:53 AM, Vladimir Makarov <email@example.com> wrote:
On 10/20/2014 11:16 PM, Maxim Kuvyrkov wrote:
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
So issue rate change is ok but I'd not rush to change dfa look ahead
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
The patch is ok without my previous request.