[erlang-questions] Threaded VM with llvm-gcc
Tue Sep 24 07:37:37 CEST 2013
On Sat, Sep 21, 2013 at 4:56 PM, Anthony Ramine <> wrote:
> I read in the installation guide  that it is recommended to use GCC 4.2
> to build Erlang because CLang and LLVM cannot use jump tables.
At least in the version of the installation guide you linked to,
it says nothing about jump tables being the reason for the
recommendation. It says that the performance will be worse
if GCC is not used, but it does not say why.
There is two problems with this:
> - This is not consistent with what the configure scripts actually do:
> CLang 3 and later use jump tables when compiling Erlang .
Yes, it is consistent since the installation guide only talks about
not jump tables.
> - There is no reason to not use LLVM 2.7 and later for beam_emu.c because
> it does compile jump tables efficiently .
It does compile jump tables efficiently, but it does a worse job
of register allocation, especially for huge function such as
process_main() in beam_emu.c. That said, code generation
has improved in each new version of clang, making it less
important to use a "real" GCC.
> Unfortunately I have no idea how to fix this, as there is no way to get
> the LLVM version from any preprocessor macro . Should we just remove the
> LLVM check from the test and let the snippet of code fail to compile ?
What is the problem you want to fix? Have you observed
any situation where jump tables where not used when they
The test is where to protect against an old broken version
of llvm-gcc that did not handle jump tables correctly.
It will also make sure that Erlang/OTP can be compiled
on systems where no compiler that supports jump tables
can be found.
Björn Gustavsson, Erlang/OTP, Ericsson AB
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions