This is the mail archive of the
mailing list for the GCC project.
Re: scheduling question
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: aturjan at yahoo dot com
- Cc: Vladimir Makarov <vmakarov at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 07 May 2009 14:01:31 +0400
- Subject: Re: scheduling question
- References: <firstname.lastname@example.org>
Alex Turjan wrote:
During scheduling Im confronted with the fact that an instruction is moved
from the ready list to queued with the cost 2, while according to my
expectations the insn should have been moved to queued with cost 1.
Did anybody experience similar problem?
From what you described it's not clear what the problem is. When
scheduler infers that an instruction cannot be scheduled in the next N
cycles (due to DFA hazard or insn_cost/dep_cost hook considerations or
due to something else) the scheduler queues the instruction on (N+1) cycle.
In case an insn is ready but can bot be schedled in the current
cycle, is it correct (i.e. the generated code is correct) to move the insn
to the queue list with cost 1 ?; no matter what it the value >=1
returned by state_transition.
Yes, that would be correct from code correctness point of view, but
state_transition() *will* make the scheduler requeue the instruction on
the next cycle, so you will just loose in compile time.
It seams to me that moving from the ready to queue list with cost >=1 is
an optimization for compilation time.
Correct, scheduler would be working unnecessarily long otherwise.