Lambda the Ultimate

inactiveTopic LLVM Compiler Infrastructure Project
started 11/7/2003; 2:32:36 PM - last post 11/10/2003; 7:15:10 PM
Bryn Keller - LLVM Compiler Infrastructure Project  blueArrow
11/7/2003; 2:32:36 PM (reads: 9124, responses: 4)
LLVM Compiler Infrastructure Project
Technology which allows for continuous optimization of a program throughout its lifetime, starting with compile time, again at link time, at run time, and in-between runs. Looks interesting. The code is available, though apparently only for Linux and Solaris at this point.

Low Level Virtual Machine (LLVM) is:

1. A compilation strategy - Fundamentally, LLVM is a compilation strategy designed to enable effective program optimization across the entire lifetime of a program. LLVM supports effective optimization at compile time, link-time (particularly interprocedural), run-time and offline (i.e., after software is installed), while remaining transparent to developers and maintaining compatibility with existing build scripts.

2. A virtual instruction set - LLVM is a low-level object code representation that uses simple RISC-like instructions, but provides rich, language-independent, type information and dataflow (SSA) information about operands. This combination enables sophisticated transformations on object code, while remaining light-weight enough to be attached to the executable. This combination is key to allowing link-time, run-time, and offline transformations.

3. A compiler infrastructure - LLVM is also a collection of source code that implements the language and compilation strategy. The primary components of the LLVM infrastructure are a GCC-based C & C++ front-end, a link-time optimization framework with a growing set of global and interprocedural analyses and transformations, static back-ends for the SPARC v9 and X86 architectures, a back-end which emits C, and a Just-In-Time compiler for X86 and SPARC v9 processors. See "Current Projects" for information about other components under development.

Posted to implementation by Bryn Keller on 11/7/03; 2:37:52 PM

Chris Lattner - Re: LLVM Compiler Infrastructure Project  blueArrow
11/7/2003; 9:52:20 PM (reads: 461, responses: 1)
Another cool thing about LLVM is that one of the main authors is an avid Lambda reader. :)

The blurb was not quite right: we do support other platforms, we just don't have native code generators/JITs for them (yet). That said, LLVM works great on Mac OS/X for example, by compiling to LLVM, performing IPO, then emitting C code to be compiled by the platform compiler.

I'm curious what other Lambda readers think about LLVM. :)


tyler - Re: LLVM Compiler Infrastructure Project  blueArrow
11/10/2003; 6:08:18 AM (reads: 343, responses: 0)
>>I'm curious what other Lambda readers think about LLVM. :)

After a quick glance at your Master's paper, it looks great. I'm also happy to hear that it works on OS X.

I must set aside some time to give to your work a fair investigation. Needless to say, I'm very interested in this.

Congrats Chris.

Bryn Keller - Re: LLVM Compiler Infrastructure Project  blueArrow
11/10/2003; 10:09:39 AM (reads: 340, responses: 0)
Chris Lattner wrote:
The blurb was not quite right: we do support other platforms, we just don't have native code generators/JITs for them (yet)

Sorry to misrepresent things! I was confused by this entry from the FAQ page:

How portable is the LLVM source code?

The LLVM source code should be portable to most modern UNIX-like operating systems. Most of the code is written in standard C++ with operating system services abstracted to a support library. The tools required to build and test LLVM have been ported to a plethora of platforms.

Some porting problems may exist in the following areas:

* The GCC front end code is not as portable as the LLVM suite, so it may not compile as well on unsupported platforms. * The Python test classes are more UNIX-centric than they should be, so porting to non-UNIX like platforms (i.e. Windows, MacOS 9) will require some effort. * The LLVM build system relies heavily on UNIX shell tools, like the Bourne Shell and sed. Porting to systems without these tools (MacOS 9, Plan 9) will require more effort.

I could have sworn I saw a page which said it was only known to work on Linux and Solaris, but I can't seem to find it now. Is the code known to build and work on Windows? Relying heavily on unix shell tools sometimes works on Windows with cygwin or msys, but oftentimes (in my experience) it does not, so I guessed from the entry above that it wasn't ready for use on (at least) Windows. I'd be more than happy to be wrong! :-)

Chris Lattner - Re: LLVM Compiler Infrastructure Project  blueArrow
11/10/2003; 7:15:10 PM (reads: 306, responses: 0)
> Is the code known to build and work on Windows?

We have had some luck compiling LLVM on other platforms. To date, we know it works on linux, solaris, freebsd, and Mac OS/X (no native code generator yet though). We have tried compiling on Cygwin for windows, and it mostly sorta work, but we keep tickling bugs in the cygwin tools.

For example:

Getting things to work under Cygwin is a goal of ours, we just don't have any machine set up for it. :) When the cygwin linker bugs are fixed, we hope that LLVM to more or less "just work". It would be interesting to compile LLVM with some other (ISO compliant) windows C++ compiler though, to see how it does.