This is the mail archive of the
mailing list for the GCC project.
Re: negative latencies
- From: shmeel gutl <shmeelgutl at shmuelhome dot mine dot nu>
- To: Vladimir Makarov <vmakarov at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 21 May 2014 00:18:08 +0300
- Subject: Re: negative latencies
- Authentication-results: sourceware.org; auth=none
- References: <5379A125 dot 5090405 at shmuelhome dot mine dot nu> <537B7121 dot 6080408 at redhat dot com>
On 20-May-14 06:13 PM, Vladimir Makarov wrote:
The architecture has an exposed pipeline where instructions read
registers during the required cycle. So if one instruction produces its
results in the third pipeline stage and a second instruction reads the
register in the sixth pipeline stage, the second instruction can read
the results of the first instruction even if it is issued three cycles
On 05/19/2014 02:13 AM, shmeel gutl wrote:
Are there hooks in gcc to deal with negative latencies? In other
words, an architecture that permits an instruction to use a result
from an instruction that will be issued later.
Could you explain more on *an example* what are you trying to achieve
with the negative latency.
Scheduler is based on a critical path algorithm. Generally speaking
latency time can be negative for this algorithm. But I guess that is
not what you are asking.
The problem that I see is that the haifa scheduler schedules one cycle
at a time, in a forward order, by picking from a list of instructions
that can be scheduled without delays. So, in the above example, if
instruction one is scheduled during cycle 3, it can't schedule
instruction two during cycle 0, 1, or 2 because its producer dependency
(instruction one) hasn't been scheduled yet. It won't be able to
schedule it until cycle 3. So I am asking if there is an existing
mechanism to back schedule instruction two once instruction one is issued.
At first glance it seems that it will will break a few things.
1) The definition of dependencies cannot come from the simple ordering
2) The scheduling problem starts to look like "get off the train 3
stops before me".
3) The definition of live ranges needs to use actual instruction
timing information, not just instruction sequencing.
The hooks in the scheduler seem to be enough to stop damage but not
enough to take advantage of this "feature".