linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH 0/4] simplification of computed goto
Date: Sat, 21 Nov 2020 22:40:26 +0100	[thread overview]
Message-ID: <20201121214026.kv4pgimxlyykfb26@ltop.local> (raw)
In-Reply-To: <CAHk-=whC2Kygu6Vpgt+vnzVGAG-ZYHk1ucOcv7b9AcvmdrY-Eg@mail.gmail.com>

On Sat, Nov 21, 2020 at 01:09:50PM -0800, Linus Torvalds wrote:
> On Sat, Nov 21, 2020 at 12:54 PM Luc Van Oostenryck
> <luc.vanoostenryck@gmail.com> wrote:
> >
> > This series contains some simplification of computed gotos with
> > 1 or 2 possible target as well as a new instruction which now
> > really allows the CSE of 'labels-as-values'.
> 
> Looks sane, but where did you actually find cases of this in real life?
>
> I think we have one computed goto in the kernel, that does an array
> label load. They are very rare, and when they are used, that tends to
> be the normal pattern.
> 

Bah, they're not really from real life.
When IR and optimizations are concerned, I'm using code from some
testsuites (GCC, LLVM, some benchmarks, code I've generated myself)
to check for anything abnormal and sometimes when inspecting the
results I fall on some testcases that doesn't make sense. Sometimes
it's because of some errors from my part but it also happens it's
one of these silly/exotic transformations.

So, yes, I'm fully aware that these patches (and some other
'optimizations' I'm sometimes adding) have practically no values
but they just make things easier for me when comparing results.

> Just about the only place I've ever seen them are in that kind of
> interpreter loops for instruction dispatch tables.

Yes. They were also fundamental to a prolog-to-C compiler I wrote
many years ago. This maybe explains some fondness I've for them.

-- Luc

  reply	other threads:[~2020-11-21 21:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21 20:52 [PATCH 0/4] simplification of computed goto Luc Van Oostenryck
2020-11-21 20:52 ` [PATCH 1/4] add testcases for COMPUTEDGOTO simplification Luc Van Oostenryck
2020-11-21 20:52 ` [PATCH 2/4] simplify OP_COMPUTEDGOTO with unique and known target Luc Van Oostenryck
2020-11-21 20:52 ` [PATCH 3/4] simplify CGOTO(SEL(x, L1, L2)) into CBR x, L1, L2 Luc Van Oostenryck
2020-11-21 20:53 ` [PATCH 4/4] add a new instruction for label-as-value Luc Van Oostenryck
2020-11-21 21:09 ` [PATCH 0/4] simplification of computed goto Linus Torvalds
2020-11-21 21:40   ` Luc Van Oostenryck [this message]
2020-11-21 22:07     ` Linus Torvalds

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=20201121214026.kv4pgimxlyykfb26@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.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 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 NNTP newsgroup(s).