gnupic: Re: [gnupic] LLVM - was Re: [gnupic] gputils development


Previous by date: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, David Barnett
Next by date: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, Ralph Corderoy
Previous in thread: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, David Barnett
Next in thread: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, Ralph Corderoy

Subject: Re: [gnupic] LLVM - was Re: [gnupic] gputils development
From: Walter Banks ####@####.####
Date: 14 Nov 2008 14:35:20 -0000
Message-Id: <491D8C5F.C0AADAC1@bytecraft.com>


David Barnett wrote:

> On Fri, Nov 14, 2008 at 4:04 AM, Vaclav Peroutka ####@####.#### wrote:
>
> > >
> > > That is a good idea. But IMHO Microchip has other ideas about
> > > this topic. They are working on LLVM port. In fact, LLVM 2.4
> > > has experimental PIC16 ports.
> > > http://llvm.org/docs/ReleaseNotes.html
> > >
> >
> > Hello Xiaofan,
> >
> > I had a look into LLVM docu, Getting started etc. There is "1. Read the
> > documentation, 2.Read the documentation". But which documantation ? I could
> > not find what is LLVM good for. And how can it help me with development for
> > PIC16 architecture.
>
> LLVM is a whole framework geared towards compiler developers, and still not
> much of a product for end-users. I don't think they have much user
> documentation yet, but the project looks very promising.
>
> If you don't know all about compilers, there's usually a front-end which
> translates from C, FORTRAN, Ada, C++, etc. into an intermediate
> representation, and a back-end which translates the intermediate
> representation into assembly or machine language for a particular arch (x86,
> ARM, etc.). LLVM is a definition of the intermediate representation and a
> lot of tools for dealing with it (optimizing, debugging...). With gcc the IR
> is much more hidden, but LLVM standardizes the IR format and makes it easier
> to enhance the whole system.
>
> They've added a PIC16 back-end now, so you can use a front-end (like
> llvm-gcc, I think) to generate the IR code, and then get PIC16 assembly or
> machine code out of that, theoretically. I haven't looked much into it
> myself, but that should be the gist of it.
>

There have been several attempts at defining standardized optimizations. All
of them including LLVM work quite well once they are written at optimizing
code for architectures similar to the original target. The problem that most
have not solved is making the optimizations relevant as the target architectures
change. LLVM's approach to standardizing IR doesn't solve this problem.

In the end it will be a test of how well the IR maps on the target. This
mapping efficiency will determine the effectiveness of LLVM on
PIC targets. To illustrate my point look at the subtract instruction on
the Microchip PICs the argument order is reversed from most processors
which in turn affects the data flow analysis need for the orderly arrival of
data to the alu on the processor. It is this type of small thing that makes
LLVM type of optimization approach fail to realize expectations.


w..




Previous by date: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, David Barnett
Next by date: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, Ralph Corderoy
Previous in thread: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, David Barnett
Next in thread: 14 Nov 2008 14:35:20 -0000 Re: [gnupic] LLVM - was Re: [gnupic] gputils development, Ralph Corderoy


Powered by ezmlm-browse 0.20.