[LLVMdev] recommendation books on code generation?

David Tweed david.tweed at arm.com
Fri Feb 22 03:14:35 PST 2013


Hi, (taking the plunge)

I believe it's the case that if one were an experienced compiler engineer
before coming to LLVM it might be a different story to if one were getting
up to speed on how compilers work by starting with LLVM (which sounds like
it might be the case here). Certainly in looking at the LLVM code in areas I
don't know about there is the undeniable fact that one is trying to
understand _production optimized_ code at the same time as trying to
understand the basic concepts the code implements, which is harder than
learning about the concepts from more basic code then studying a better
implementation. I don't know of a book, but as a suggestion: is there anyone
who's teaching a course on compilers using LLVM who has the lecture notes
(or even better actual lectures) online?

Cheers,
Dave

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Reed Kotler
Sent: 22 February 2013 11:02
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] recommendation books on code generation?

If you wanted to write a new register allocator, that would be a 
different story.

Then you would do well to read the literature to try and understand 
about various schemes that have already been invented.

No need to reinvent the wheel.

Most people doing a port can figure things out by just using their brain 
and the documentation already at the LLVM web site; but like I said, a 
good solid knowledge of modern C++ and STL is necessary; otherwise you 
may struggle with code that is really very simple but is hard to 
understand because of the language issues.

Reed



On 02/22/2013 02:32 AM, Reed Kotler wrote:
> I don't think you need any special books.
>
> There is nothing complicated going on that is not in a basic compiler
> book. Mostly you have to understand how they implemented basic things in
> this framework.
>
> Knowing modern C++ (i.e. templates, overloading, etc...) and STL pretty
> well is more important than knowing about compiler theory in order to
> understand things.
>
> The documentation online just needs to be read many times and you need
> to do your own port or try and understand one for an architecture that
> you already know pretty well.
>
> http://llvm.org/docs/ProgrammersManual.html
> http://llvm.org/docs/
>
> You need to know what a phi node is. That is about the only thing that
> is mostly something you could not just learn from reading the code
> because it's a special term.
>
> http://en.wikipedia.org/wiki/Static_single_assignment_form
>
> Reed
>
>
> On 02/21/2013 11:48 PM, Jun Koi wrote:
>> hi,
>>
>> i am reading LLVM code, focusing on the code generation (backend) part.
>> however, it is still rather tough to understand all the code, so i think
>> i need to improve my background on compiler backend first.
>>
>> any recommendation on good books that introduces all the related
>> techniques used by LLVM: DAG lowering, DAG legalization,instruction
>> selection, scheduling, register allocation, etc...
>>
>> i looked at the Dragon book, but it seems outdated, and didnt introduce
>> all the above concepts.
>>
>> many thanks,
>> Jun
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>


_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev








More information about the llvm-dev mailing list