All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Derek M Jones <derek@knosof.co.uk>
Cc: Pekka Enberg <penberg@kernel.org>,
	Christopher Li <sparse@chrisli.org>,
	linux-sparse@vger.kernel.org, Jeff Garzik <jeff@garzik.org>,
	Josh Triplett <josh@joshtriplett.org>
Subject: Re: [ANNOUNCE] LLVM backend for Sparse
Date: Mon, 29 Aug 2011 09:58:36 -0700	[thread overview]
Message-ID: <CA+55aFwmtOQgksqdWH=PrsPcDaG44kKBu+3knz9h4zJLGD4X8g@mail.gmail.com> (raw)
In-Reply-To: <4E5BACEB.7020502@knosof.co.uk>

On Mon, Aug 29, 2011 at 8:14 AM, Derek M Jones <derek@knosof.co.uk> wrote:
>
> Can people allay my concern that this work is not on the slippery
> slope leading to sparse becoming the recommended compiler for
> building the kernel?

That was never really a goal.

What *was* a goal for me a long time ago was to make sparse be a
"preprocessor" in front of gcc, because the standard C pre-processor
has always been weak and we've always abused it in nasty ways (look at
all the games we play with "sizeof" and "typeof" to make our
"kernel-C" have a kind of generic programming).

Having a semantically aware preprocessor would allow kernel-specific
type extensions (like the "__user" attribute we already use purely for
checking runs), and allow debug facilities like "trace accesses to
this variable" without having to have ugly and unreadable wrappers
etc.

But even that got put on the back-burner when gcc improved the
pre-processor performance. It used to be a separate phase, and quite
slow, and having a quick semantic analysis in front of cc1 that
replaced the gcc preprocessor wouldn't have been a big slow-down. But
with the new (well, no longer new) built-in pre-processor, a sparse
front-end would slow down kernel compiles noticeably.

The main reason I used to want to have a back-end was that without a
back-end you cannot really verify the front-end. You can read
"test-linearize" output all day long, you'll never really get very
far. Once you generate code, and can use the thing to actually compile
real programs, that gives you *way* more confidence that you're doing
things right.

                          Linus

  parent reply	other threads:[~2011-08-29 16:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-28  6:08 [ANNOUNCE] LLVM backend for Sparse Pekka Enberg
2011-08-28  8:51 ` Christopher Li
2011-08-28 13:51   ` Pekka Enberg
2011-08-28 14:01   ` Pekka Enberg
2011-08-28 16:54     ` Linus Torvalds
2011-08-29  7:41       ` Pekka Enberg
2011-08-29  9:19         ` Christopher Li
2011-08-29 11:05           ` Pekka Enberg
2011-08-29 14:22   ` Pekka Enberg
2011-08-29 15:14     ` Derek M Jones
2011-08-29 15:33       ` Jeff Garzik
2011-08-29 15:42         ` Derek M Jones
2011-08-29 15:45           ` Pekka Enberg
2011-08-29 16:58       ` Linus Torvalds [this message]
2011-08-29 15:27     ` Jeff Garzik

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='CA+55aFwmtOQgksqdWH=PrsPcDaG44kKBu+3knz9h4zJLGD4X8g@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=derek@knosof.co.uk \
    --cc=jeff@garzik.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=sparse@chrisli.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.