[erlang-questions] Threaded VM with llvm-gcc
Sat Sep 21 16:56:22 CEST 2013
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.
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 .
- There is no reason to not use LLVM 2.7 and later for beam_emu.c because it does compile jump tables efficiently .
Feel free to compile the following example code to LLVM-IR with llvm-gcc -s -emit-llvm or clang -s -emit-llvm:
int x = magic();
static void *jtab;
jtab = &&lbl1;
jtab = &&lbl2;
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 ?
More information about the erlang-questions