gcc4 or gcc3?

I just downloaded the CVS version of llvm and llvm-test. Presumably
this is the one that's scheduled to become 1.8 in a few days.

(1) To install llvm, do I really need the llvm version of the gcc front
end? I have no special interest in yet another c/c++ conmpiler.

(2) If I need llvm gcc, will the binary version suffice, or do I need
to compile the CVS version?

(3) If I need its source code, does it properly fit within the
llvm/projects directory, just like the test suite? And it that where I
should execute the cvs co, like like the test suite? Or is it so
independent that I should put it totally elsewhere in the file
system?

(4) The page http://llvm.org/docs/GettingStarted.html#checkout says to get
the gcc 3.4 source code.
The instructions to compile it in http://llvm.org/docs/CFEBuildInstrs.html
seem to deal in gcc 3 and gcc 4 instead. Is this an error in the
documentation, or does it indicate that I should compile the llvm-gcc 3.4
source code with GNU's gcc versions 3 or 4 depending on what;'s already
installed on my system.

-- hendrik

(1) To install llvm, do I really need the llvm version of the gcc front
end? I have no special interest in yet another c/c++ conmpiler.

You need it if you plan to compile C/C++ program to llvm bytecode. You don't if you plan to write llvm bytecode directly.

(2) If I need llvm gcc, will the binary version suffice, or do I need
to compile the CVS version?

You can use the binary (either llvm-gcc4 or llvm-gcc3).

(3) If I need its source code, does it properly fit within the
llvm/projects directory, just like the test suite? And it that where I
should execute the cvs co, like like the test suite? Or is it so
independent that I should put it totally elsewhere in the file
system?

No. Its separate. I put it in its own directory.

(4) The page http://llvm.org/docs/GettingStarted.html#checkout says to get
the gcc 3.4 source code.
The instructions to compile it in http://llvm.org/docs/CFEBuildInstrs.html
seem to deal in gcc 3 and gcc 4 instead. Is this an error in the
documentation, or does it indicate that I should compile the llvm-gcc 3.4
source code with GNU's gcc versions 3 or 4 depending on what;'s already
installed on my system.

I would use llvm-gcc4 if possible. The CFEBuildInstrs has instructions for obtaining llvm-gcc4 source and building.

http://llvm.org/docs/CFEBuildInstrs.html#instructions

-Tanya

(4) The page http://llvm.org/docs/GettingStarted.html#checkout says to get
the gcc 3.4 source code.
The instructions to compile it in http://llvm.org/docs/CFEBuildInstrs.html
seem to deal in gcc 3 and gcc 4 instead. Is this an error in the
documentation, or does it indicate that I should compile the llvm-gcc 3.4
source code with GNU's gcc versions 3 or 4 depending on what;'s already
installed on my system.

Actually, I misread your question. The instructions for llvm-gcc3 and llvm-gcc4 have nothing do with what version of gcc you have installed on your system. They refer to which version of gcc was modified to output llvm bytecode. You can use whatever gcc is on your system to compile either (as long as its not in the FAQ as known not to work).

-Tanya

Hi Hendrik,

I just downloaded the CVS version of llvm and llvm-test. Presumably
this is the one that's scheduled to become 1.8 in a few days.

Not really. The current CVS head is quite a ways past release 1.8 at
this point. If you want to get the release 1.8 preview, please check out
the release_18 branch:

cvs co -rrelease_18 llvm

(1) To install llvm, do I really need the llvm version of the gcc front
end? I have no special interest in yet another c/c++ conmpiler.

No, you can build LLVM without it. Some functionality will be disabled,
however (like the test cases for C/C++).

(2) If I need llvm gcc, will the binary version suffice, or do I need
to compile the CVS version?

Binary version should be okay.

(3) If I need its source code, does it properly fit within the
llvm/projects directory, just like the test suite? And it that where I
should execute the cvs co, like like the test suite? Or is it so
independent that I should put it totally elsewhere in the file
system?

It's independent, put it somewhere else :slight_smile:

(4) The page http://llvm.org/docs/GettingStarted.html#checkout says to get
the gcc 3.4 source code.

The link above is for accessing llvm-gcc3 which was based on gcc 3.4
source code.

The instructions to compile it in http://llvm.org/docs/CFEBuildInstrs.html
seem to deal in gcc 3 and gcc 4 instead. Is this an error in the
documentation, or does it indicate that I should compile the llvm-gcc 3.4
source code with GNU's gcc versions 3 or 4 depending on what;'s already
installed on my system.

No, its not an error. Perhaps what you're misunderstanding is that there
are two versions of llvm-gcc. The first, which we call llvm-gcc3, is
based on gcc 3.4 and you can get that via CVS or release tarball. THe
second version, which we call llvm-gcc4, is based on gcc 4.0.1 and is
maintained by Apple. They were nice enough to provide a subversion
repository to access it. In general, LLVM is slowly transitioning to
using the llvm-gcc4 front end. Currently its missing a couple features
(most notably exception handling in C++, compile time optimization), but
in general it is already easier to deal with because it works just like
GCC and doesn't require an llvm-based run-time library. These
deficiencies will most likely get corrected in the near future (probably
by the end of the year or sooner). At that time, we'll probably
deprecate llvm-gcc3 (release 1.10?) and just use llvm-gcc4.

Note: this email contains forward-looking statements that I don't want
to be held accountable for, so read it with a grain of salt. :slight_smile:

Reid.

Hi Hendrik,

I just downloaded the CVS version of llvm and llvm-test. Presumably
this is the one that's scheduled to become 1.8 in a few days.

Not really. The current CVS head is quite a ways past release 1.8 at
this point. If you want to get the release 1.8 preview, please check out
the release_18 branch:

cvs co -rrelease_18 llvm

(1) To install llvm, do I really need the llvm version of the gcc front
end? I have no special interest in yet another c/c++ conmpiler.

No, you can build LLVM without it. Some functionality will be disabled,
however (like the test cases for C/C++).

(2) If I need llvm gcc, will the binary version suffice, or do I need
to compile the CVS version?

Binary version should be okay.

(3) If I need its source code, does it properly fit within the
llvm/projects directory, just like the test suite? And it that where I
should execute the cvs co, like like the test suite? Or is it so
independent that I should put it totally elsewhere in the file
system?

It's independent, put it somewhere else :slight_smile:

(4) The page http://llvm.org/docs/GettingStarted.html#checkout says to get
the gcc 3.4 source code.

The link above is for accessing llvm-gcc3 which was based on gcc 3.4
source code.

The instructions to compile it in http://llvm.org/docs/CFEBuildInstrs.html
seem to deal in gcc 3 and gcc 4 instead. Is this an error in the
documentation, or does it indicate that I should compile the llvm-gcc 3.4
source code with GNU's gcc versions 3 or 4 depending on what;'s already
installed on my system.

No, its not an error. Perhaps what you're misunderstanding is that there
are two versions of llvm-gcc. The first, which we call llvm-gcc3, is
based on gcc 3.4 and you can get that via CVS or release tarball. THe
second version, which we call llvm-gcc4, is based on gcc 4.0.1 and is
maintained by Apple.

In a paper called something like "slim binaries" a few years ago, the
author claimed that they were more efficient than conventional
machine-level executables. That they consisted of was extremely compact
intermediate code. Apparently the time taken to generate machine code
from the intermediate code was dwarfed by the time that would have been
taken to read the executable machine code from disk (slow I/O and all
that). What's more, storing the intermediate code took a lot less space
than the machine code, so it was a win there, too. Now the compression
techniques they used were quite dependent on the details of the source
language they used (Oberon), so it's not clear how much these techniques
translate to other systems. But it's quite possible that the technique
could be quite effective for a company that has to make its software
run compatibly on multiple architectures. It's certainly something I've
considered, and llvm seems a useful tool for building it.

I believe the guy that did the slim binaries trademarked the name, but as
far as I know has done nothing with it since. I've tried to email him
unsuccessfully.

I actually plan to do something like this with HLVM (http://hlvm.org/).
At this point it is unclear whether the implementation will be in HLVM
or LLVM. One issue with LLVM bytecode is that it isn't *that* much
smaller than native code (depends on target). Assuming the bytecode was
already optimized, translating to native code should be, as you
suggested, relatively quick. In fact, LLVM's JIT already does this. If
your front end produces target-independent bytecode then its possible to
transport just the bytecode and run it anywhere the LLVM JIT runs .. or
even statically compile it to a target that is supported. Note that the
C Backend makes many targets available that are not otherwise supported
by LLVM.

Reid.