public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Reshabh K Sharma <reshabh@cs.washington.edu>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Jeff Law <jeffreyalaw@gmail.com>, gcc-help@gcc.gnu.org
Subject: Re: Describe instructions with same reg in def and use or mutiple defs and attach write latency
Date: Thu, 3 Feb 2022 17:06:23 -0800	[thread overview]
Message-ID: <CAAhFPT1w5ddYgqG93vv7LvAVVjBXYdduepFJ2Gx7tRzpgKjoMA@mail.gmail.com> (raw)
In-Reply-To: <20220128182105.GF614@gate.crashing.org>

On Fri, Jan 28, 2022 at 10:23 AM Segher Boessenkool <
segher@kernel.crashing.org> wrote:

> On Fri, Jan 28, 2022 at 10:39:54AM -0700, Jeff Law via Gcc-help wrote:
> > On 1/26/2022 6:20 PM, Reshabh K Sharma via Gcc-help wrote:
> > >I am trying to implement a post address update load instruction in our
> > >downstream riscv backend. I want to attach write latency information to
> a
> > >use register. For example, rd = new_load rs1 rs2, I want to attach
> separate
> > >write latency information to both rd and rs1.
> > >
> > >I am unable to find how to describe instructions that have an operand as
> > >both def and use, and later attach write latency information for the
> > >instruction scheduler to work properly.
> > >
> > >It will also be very helpful if you can point me to the implementation
> of
> > >similar instructions in other backends, for example, LBZU in PowerPC,
> ARM's
> > >LWD post/pre address update versions and ARM's neon simd load with
> update.
> > I'm not sure the scheduler can model different latencies for the
> > multiple outputs.  If anyone knows for sure, it would be Vlad.
>
> You can use TARGET_SCHED_ADJUST_COST?
>

Thank you so much! I think target_sched_adjust_cost will do.
Given two rtx_insn,
x = exp_load addr offset and
y = add addr z,
these two instructions are the input arguments to target_sched_adjust_cost,

how do I check that given rtx_insn is exp_load? (how do we check if
rtx_insn is of type exp_load, add or any other target specific instruction?)
and how do I check if there is a read after read dependency for addr
operand and not the offset.

> It may not matter in practice though.  I'd hazard a guess these things
> > hang out in the reorder buffer until both outputs are ready and only
> > then will it move into the retirement queue.
>
> The GCC scheduling description says when results are ready, not when the
> instructions (can) finish or complete (aka retire).  I do agree this
> case doesn't matter so much, cases where it does matter will have their
> dependency chains broken much earlier :-)
>
>
> Segher


Thanks again for the help!

Reshabh

  reply	other threads:[~2022-02-04  1:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27  1:20 Reshabh K Sharma
2022-01-28 17:39 ` Jeff Law
2022-01-28 18:21   ` Segher Boessenkool
2022-02-04  1:06     ` Reshabh K Sharma [this message]
2022-02-04  1:31       ` Segher Boessenkool
2022-02-16 19:41         ` Reshabh K Sharma
2022-02-17 18:48           ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAhFPT1w5ddYgqG93vv7LvAVVjBXYdduepFJ2Gx7tRzpgKjoMA@mail.gmail.com \
    --to=reshabh@cs.washington.edu \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).