Table of Contents

LLVM Update

This page summarizes the effort of updating LegUp from LLVM 2.9 to LLVM 3.4.

LegUp Source Changes Required

LLVM Header Files Moved/Deprecated

The following header files have been renamed or removed. The functionality seems identical in most cases.

LLVM Objects and Functions Renamed/Deprecated

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.

Functionality Added to LegUp

ConstantDataArray

LLVM 3.4 now uses ConstantDataArray in several places where a ConstantArray was used previously.
ConstantDataArray support was added to some LegUp files including:

Ram.cpp

Ram.h

GenerateRTL.cpp

IterativeModuloScheduling.cpp

LegUp Makefile Changes Required

llvm-ld Deprecated

Use:

llvm-link ...
llvm-opt -std-link-opts ...

instead.

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 Deprecated

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.

LLVM Profiling Deprecated

Vectorization

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.

MIPS1 Target Deprecated

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.

Changes Required to LegUp Examples

Disable LegUp Features

It was necessary to disable LOCAL_RAMS for the following benchmarks:

chstone/blowfish

chstone/gsm

It was necessary to disable GROUP_RAMS_SIMPLE_OFFSET for the following benchmarks:

chstone/jpeg

Other

chstone_hybrid/dfsin: the linker complains about multiple definitions of 'sin' when linking with libm.bc. sin() was renamed to dfsin() to fix this problem.

use_begin iterator is now user_begin. Don't use the use_ iterators directly any more. Use is now a bookkeeping helper class for the User class. See: