All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Pekka Enberg <penberg@kernel.org>,
	Sparse Mailing-list <linux-sparse@vger.kernel.org>,
	josh@joshtriplett.org
Subject: Re: [PATCH] Re: LLVM and PSEUDO_REG/PSEUDO_PHI
Date: Sun, 28 Aug 2011 12:46:16 -0700	[thread overview]
Message-ID: <CA+55aFwcfL16REFvFe7MLsnr73_24x86biPGu2XD+ZmocZR_mA@mail.gmail.com> (raw)
In-Reply-To: <4E5A97A1.4010504@garzik.org>

On Sun, Aug 28, 2011 at 12:31 PM, Jeff Garzik <jeff@garzik.org> wrote:
>
> But that comment was thinking more medium term, supporting multiple
> platforms means properly handling struct layout in memory, which gets into
> the realm of platform-specific ABIs.
>
> It didn't seem like we would want to encode a ton of ABI detail into the
> sparse C front-end.  But it sounds like there will be a lot of ABI detail
> found, if sparse is doing all the memory layout and such.

But you *have* to encode it into the front end.

Things like size and alignment of types is exactly what sparse was all
about from the beginning. And if the front-end doesn't know the
offsets into structures, it cannot do any of the load/store
optimizations, which all very much depend on alias information, and
which are how sparse does a lot of the semantic analysis.

A number of the things sparse already does (ie the lock analysis etc)
very much depends on being able to do CSE over accesses to local
variables etc, which originally were memory operations - turning those
memops into registers etc is how sparse can follow things like
branches to branches and optimize them away, which it needs to handle
things like "if (trylock()) -> unlock" sequences.

Now, admittedly we could do much of that without necessarily handling
the *generic* case of loading/storing to structure members etc,
because the case we tend to care about in the sparse code analysis
phase tends to be about the trivial "local variable" case, so in that
sense sparse does a lot more than strictly necessary for just
following the code. But it's much nicer (I think) to have a tool that
really understands the code, than just apply patterns to it.

Of course, "just applying patterns to it" is actually what coccinelle
does, and it has been very successful. So ..

                      Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-08-28 19:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4E5495C9.6050207@kernel.org>
     [not found] ` <CA+55aFwLLn30qohqJeBZLVUYWLKUnbBxnL9u+v=4Fx8TpxDQUQ@mail.gmail.com>
     [not found]   ` <4E55F33C.50203@kernel.org>
     [not found]     ` <CAOJsxLF-=mPSdKLwmc61ZRTQrLGjPTUwVw+PqabYvGKVRwh9sQ@mail.gmail.com>
     [not found]       ` <CAOJsxLFMz7fs4ySkizHk43a0fz9VKS5ReWXoJa8cy2AQ6iwRng@mail.gmail.com>
     [not found]         ` <CA+55aFywG3vBA87W2h1f=-H144MTZesEwp5jVu8ndyBfLX7Sbg@mail.gmail.com>
     [not found]           ` <alpine.DEB.2.00.1108252046090.6272@localhost6.localdomain6>
     [not found]             ` <CA+55aFxRkS4HLeW18-q+4Co7kRdiQBv4wnD=GX5ymAGigXR3MQ@mail.gmail.com>
     [not found]               ` <alpine.DEB.2.00.1108252107210.6272@localhost6.localdomain6>
     [not found]                 ` <4E58731A.7010708@garzik.org>
     [not found]                   ` <alpine.DEB.2.00.1108271104440.2570@localhost6.localdomain6>
     [not found]                     ` <4E58AE9E.1090601@garzik.org>
     [not found]                       ` <4E59478C.9000504@garzik.org>
     [not found]                         ` <alpine.DEB.2.00.1108280815530.2734@localhost6.localdomain6>
2011-08-28 10:04                           ` [PATCH] Re: LLVM and PSEUDO_REG/PSEUDO_PHI Jeff Garzik
2011-08-28 10:18                             ` Jeff Garzik
2011-08-29 14:45                               ` Pekka Enberg
2011-08-28 17:04                             ` Linus Torvalds
2011-08-28 17:52                               ` Josh Triplett
2011-08-28 18:23                                 ` Linus Torvalds
2011-08-28 19:33                                   ` Jeff Garzik
2011-08-31 12:09                                     ` Pekka Enberg
2011-08-28 19:31                               ` Jeff Garzik
2011-08-28 19:46                                 ` Linus Torvalds [this message]
2011-08-29 14:42                             ` Pekka Enberg
2011-08-29 15:14                               ` Jeff Garzik
2011-08-29 16:16                               ` Josh Triplett
     [not found]                 ` <alpine.DEB.2.00.1108252310490.22479@localhost6.localdomain6>
     [not found]                   ` <CA+55aFy3TUT=BFD+Nb9H6uDBhz427kC4tBc+ehQDs6JBggTuHQ@mail.gmail.com>
     [not found]                     ` <4E573A3E.6060104@kernel.org>
     [not found]                       ` <CA+55aFzbV0OvrtkzbjxvL1tkfF=+6xbBsyWb8XtAcK-YNeKjZw@mail.gmail.com>
     [not found]                         ` <alpine.DEB.2.00.1108271214410.14365@localhost6.localdomain6>
     [not found]                           ` <CA+55aFzbfD4RDe52HCL9mfSYMzFdvP96OiK5ifkfUKNkzjJNrg@mail.gmail.com>
2011-08-29 19:45                             ` Pekka Enberg
2011-08-29 19:52                               ` Jeff Garzik
2011-08-29 20:32                               ` Linus Torvalds
2011-08-29 20:42                                 ` Pekka Enberg

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+55aFwcfL16REFvFe7MLsnr73_24x86biPGu2XD+ZmocZR_mA@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=jeff@garzik.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=penberg@kernel.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.