[llvm-dev] What was the IR made for precisely?

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Thu Oct 27 13:57:24 PDT 2016


> On Oct 27, 2016, at 3:05 AM, ジョウェットジェームス via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hi,
> wanting to build up some language of my own, I have always thought about feeding my compiler output to a C compiler like gcc or clang, however when I learned about (considered using) LLVM IR I immediately thought it could be of some help.
> 
> LLVM doesn't seem to be portable though, some people seem to say "If you are generating C then why not go all the way and generate some intermediate representation like LLVM IR?", but what do they mean?
> 
> C is like a portable assembly, I just have to check my numeric limits and be careful about portability and it's OK. With LLVM IR I will have to take the target platform into consideration when I compile.
> 
> This leads to my second question, what is the true goal of LLVM IR? I feel like some people are disagreeing on this aspect.

Here is an introduction:
http://www.aosabook.org/en/llvm.html

It has this to say about generating C code:
"Unfortunately, doing this prevents efficient implementation of exception handling, provides a poor debugging experience, slows down compilation, and can be problematic for languages that require guaranteed tail calls (or other features not supported by C)."

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161027/8bb218c7/attachment.html>


More information about the llvm-dev mailing list