[LLVMdev] backend documentation

Reed Kotler rkotler at mips.com
Sun Feb 24 07:25:03 PST 2013


The Sparc port is maybe the closest thing to a text book example at this 
time. You can study it; debug some examples and trace through things.

It's very simple because nobody is working on the Sparc port to make it 
a commercial compiler for the Sparc platform; yet at the same time it 
has complex patterns, custom inserters etc and all the elements of a 
more serious port.

Most people learn LLVM by trying to do something with it and not just 
reading about it. I too wanted some better documentation and more 
complete examples and such but if you wait for that; you will wait for a 
very long time (several years at least).

Tablegen is a vital tool to LLVM; yet there is little written about it; 
especially not about the code generation use of it.

There are people that have done whole ports that have lots of holes in 
their knowledge; like myself for example and friends of mine that work 
at other companies that have done whole ports.

As I've mentioned before on the list; make sure your C++ and STL is 
pretty good; that is one area that can hang you up.

A lot of the information that you want is in the documents that already 
exist but you have to get some experience with LLVM and go back and read 
and re-read them many times in order to grock the whole thing.

Reed

On 02/23/2013 05:47 PM, Vadim Khoptynets wrote:
> Hello everyone!
>
> Is there any documentation about LLVM backend implementation, except
> "Writing an LLVM backend"? I'm trying to write InstrFormats.td and
> InstrInfo.td for my backend now. After reading "Writing an LLVM backend"
> and "Creating an LLVM Backend for the Cpu0 Architecture", many black
> holes have remained. These tutorials describe it on concrete examples,
> but general approach is missed. For example, how to implement different
> addressing modes using ComplexPattern? How to write a matching function?
> How does addressing modes correlate with address operands? When should
> we implement our own DAG nodes? Why does some backends have Format
> field, while other - don't? And so on...
> So, maybe somebody have materials that could help to clarify process of
> implementing backend? It might be books, articles, presentations etc.
>
> --
> Regards,
> Vadim.
>
>
> _______________________________________________
> 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