[LLVMdev] LLVM IR is a compiler IR

Renato Golin rengolin at systemcall.org
Tue Oct 4 16:06:54 PDT 2011


On 4 October 2011 23:54, Jianzhou Zhao <jianzhou at seas.upenn.edu> wrote:
> This sounds interesting. I did not get what is a ``rich type system to
> express all of the DWARF semantics''. Could you show an example
> program that the rich type system can define, but the current IR fails
> to present? And how does it improve the IR?

Any code with C++ classes, C unions and bit-fields would be much
improved. Talin might help you with non-C++ types.

Basically anything that has to be kludged to be lowered to IR would
benefit from a higher-level IR. ByValue calls, self pointers, RTTI,
virtual inheritance, multiple inheritance.

Dan's argument that IR is unstable is clear when you get to write a
front-end from scratch. The first front-end generated a lot of kludge
to lower C++, since it'd take years to implement it properly in IR
(and all back-ends). The second, third and so on were forced to follow
the same kludge. Non-C++ front-ends suffer even more, since they have
to kludge their languages into a C++-semantic kludge, which has no
1-to-1 relationship with the original semantics of their code.

Search on the list about the topics above and you'll see that there
was a lot of discussion wasted on them for years and years.


-- 
cheers,
--renato

http://systemcall.org/



More information about the llvm-dev mailing list