This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: negative latencies
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: shmeel gutl <shmeelgutl at shmuelhome dot mine dot nu>, Vladimir Makarov <vmakarov at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Fri, 23 May 2014 12:59:08 +0200
- 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> <537BC690 dot 2030807 at shmuelhome dot mine dot nu> <537CC6A8 dot 6090607 at redhat dot com> <537E23F2 dot 9020302 at codesourcery dot com> <537F01B0 dot 5040200 at shmuelhome dot mine dot nu>
On 05/23/2014 10:07 AM, shmeel gutl wrote:
Exposed pipeline is not my problem. Negative latency is my problem. I
don't see negative latency for c6x, not in unit reservations and not in
adjust cost. Did I miss something?
You just need to model it differently. Rather than saying instruction A
has a negative latency relative to instruction B, you need to describe
that instruction B reads its inputs later than when it is actually
issued. The mechanism used in the C6X backend is the scheduler's
record_delay_slot_pair function.
The scheduler would see
B is issued (*)
<some cycles>
A is issued, executes and writes its outputs
<some more cycles>
B reads its inputs (*)
The two insns marked as (*) would be such a delay pair. The first one
would generate code, the second one exists only for the purposes of
building the right scheduling dependencies.
Bernd