From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC] rationale for systematic elimination of OP_SYMADDR instructions
Date: Fri, 11 Aug 2017 00:16:18 +0200 [thread overview]
Message-ID: <CAExDi1QVzkOVRxe+mdsHEi4=wirRFKrO+UFRDH2498z43oZidw@mail.gmail.com> (raw)
In-Reply-To: <CANeU7QkJy-G4EXuJ94KBcmo3Bc0Pei0uQSTeYr-u4DxsSK==uQ@mail.gmail.com>
On Thu, Aug 10, 2017 at 5:01 PM, Christopher Li <sparse@chrisli.org> wrote:
>
> Please correct me if I am wrong. I still think:
> 1) OP_SYMADDR can be generated from the symbol node and where
> to place them (immediate D(N)).
>
> 2) If one of the back end needs them. Go ahead and generate OP_SYMADDR.
> However, I don't think sparse checker need to use the OP_SYMADDR
> so it will be more optimal for sparse checker to avoid OP_SYMADDR.
>
> Am I missing some thing?
I'm not sure to understand exactly what you mean here above, sorry.
But yes, I think you're missing something.
All this have already been explained during the initial discussion but:
* those OP_SYMADDR represent the *calculation* that is needed to get
the address of a symbol.
* depending on the architecture, the kind/linkage/visibility of the symbol,
compiler flag, ... this calculation can be very simple, like:
- just a constant (but a big one)
- just a load at a constant address & a constant address
- or much more complicated
* the OP_SYMADDR *abstract* away the *details* of this calculation
but it is important to expose it
* of the reasons we want to expose it is that we *want* to do CSE on
these calculations
* there is absolutely no reasons why we should process them differently
than any other instructions. In particular, it would be absurd to:
- try to put all of them at the top
- try to place them ourself at some other special place (common parent,
dominator, ...)
because CSE will place them automatically at the best place: as near as
possible from where they are needed.
* it would also be a very bad idea to *not* generate them and only let the
backend generate them because it would then mean that iether:
- no CSE on them
- backend need to reimplement CSE for them
The backend, just need to *expose the details*, maybe change those
SYMADDR in the appropriate loads & adds & loads or whatever but
they need to be already there and processed by the middle-end.
-- Luc
next prev parent reply other threads:[~2017-08-10 22:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 14:20 [RFC] rationale for systematic elimination of OP_SYMADDR instructions Luc Van Oostenryck
2017-04-25 19:20 ` Christopher Li
2017-04-26 2:49 ` Luc Van Oostenryck
2017-04-26 11:33 ` Christopher Li
2017-04-26 12:17 ` Luc Van Oostenryck
2017-04-26 21:02 ` Christopher Li
2017-04-26 23:02 ` Luc Van Oostenryck
2017-08-10 15:01 ` Christopher Li
2017-08-10 22:16 ` Luc Van Oostenryck [this message]
2017-08-11 1:17 ` Christopher Li
2017-08-11 12:25 ` Luc Van Oostenryck
2017-04-26 16:15 ` Linus Torvalds
2017-04-26 23:04 ` Luc Van Oostenryck
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='CAExDi1QVzkOVRxe+mdsHEi4=wirRFKrO+UFRDH2498z43oZidw@mail.gmail.com' \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.