This page summarizes the effort of updating LegUp from LLVM 2.9 to LLVM 3.4.
The following header files have been renamed or removed. The functionality seems identical in most cases.
Red highlighting indicates changes that may cause problems, or may not be functionally correct.
Yellow highlighting indicates changes that are probably fine, but may need to be double checked.
Unhighlighted rows indicate trivial changes that should have little or no effect.
LLVM 3.4 now uses ConstantDataArray in several places where a ConstantArray was used previously. ConstantDataArray support was added to some LegUp files including:
llvm-link ... llvm-opt -std-link-opts ...
Unfortunately llvm-link cannot link archive files, only .bc files. As a result, instead of linking with liblegup.a, libm.a, etc, we need to link with liblegup.bc, libm.bc, etc, which are basically the same thing, just in a different format.
llvm-gcc was used for OpenMP support. The LLVM project “dragonegg” can be used instead. dragonegg is a gcc plugin. It will be compiled along with the rest of LegUp. It requires gcc 4.5, 4.6, 4.7, or 4.8, and the corresponding gcc-4.X-plugin-dev package (available using apt-get). The main LegUp Makefile assumes the packages gcc-4.6 and gcc-4.6-plugin-dev are installed. If you wish to use a different version of gcc, you must change the DRAGONEGG variable in legup/examples/Makefile.config and DRAGONEGG_GCC_VERSION in legup/Makefile and recompile LegUp.
The -insert-edge-profiling pass no longer exists. LLVM libprofile_rt.so/.a no longer exists.
These things have simply been commented out for now.
LLVM 3.4 now produces vectorized code that is not currently supported by LegUp. Adding clang flags -fno-vectorize and -fno-spl-vectorize seems to solve this problem for now. In the future it may be desirable to add this functionality to LegUp in order to obtain more parallel hardware. See LLVM 3.4 Auto-Vectorization for more info.
llc no longer has a backend for mips1. Compiling for mips32 with flags -mno-ldc1-sdc1 -soft-float produces somewhat similar code, but it is still not perfect. An awk command can be used to lower conditional move instructions, and add a nop after each lw. Also, the LLVM mips backend was modified to not produce DSP instructions. This seems to work well enough that the mips binutils can assemble working binaries for Tiger.
It was necessary to disable LOCAL_RAMS for the following benchmarks:
It was necessary to disable GROUP_RAMS_SIMPLE_OFFSET for the following benchmarks:
for (... i = I->use_begin() ... Instruction *user = cast<Instruction>(i->getUser());
The following optimization passes were disabled:
These passes were run with opt -std-link-opts; however, they caused several of our benchmarks to fail. There is probably a better solution than simply disabling these passes.
LLVM 3.4 produces calls to more intrinsic functions. Additional source files were copied from newlib/libm into legup/examples/lib/llvm/libm, and compiled into libm.bc.
LegUp with LLVM 3.4 requires that the appropriate version of Clang is in your $PATH. The LLVM 3.4 Clang binary can be obtained from the LLVM download website: LLVM 3.4 Downloads