LLVM

From Parts
Jump to: navigation, search

(Non-Blue Gene content moved to https://github.com/jeffhammond/HPCInfo/wiki/LLVM)

Blue Gene

Hal Finkel has ported LLVM to Blue Gene/P and Blue Gene/Q. We find that LLVM outperforms GCC most (all?) of the time and is often competitive with IBM XLC. Unlike IBM XLC, Clang can handle complex C++ programs.

BGClang has additional information and pointers to the Trac page and mailing list.

Slides

See http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf for Hal's slides on autovectorization and http://www.alcf.anl.gov/sites/www.alcf.anl.gov/files/espllvmpres.pdf for slides on using LLVM on Blue Gene/Q.

Performance

We have some data that will go here eventually.

Development

Tukey

Release

#!/bin/bash
LLVM_ROOT=$HOME/LLVM
LLVM_VERSION=3.3

TARGET=x86_64

cd ${LLVM_ROOT}

for p in llvm cfe lldb test-suite ; do
  FILE=${p}-${LLVM_VERSION}.src.tar.gz
  if [ -f ${FILE} ] ; then
    echo ${FILE} already exists! Using existing copy.
  else
    wget http://llvm.org/releases/${LLVM_VERSION}/${FILE}
  fi
done

DIR=llvm-${LLVM_VERSION}.src
if [ ! -d ${DIR} ] ; then
  tar -xzf ${DIR}.tar.gz
fi

DIR=llvm-${LLVM_VERSION}.src
if [ ! -d ${DIR} ] ; then
  tar -xzf ${DIR}.tar.gz
fi

cd ${LLVM_ROOT}/llvm-${LLVM_VERSION}.src/tools

DIR=cfe-${LLVM_VERSION}.src
if [ ! -d ${DIR} ] ; then
  tar -xzf ${DIR}.tar.gz
fi
if [ -h clang ] ; then
  rm clang
fi
ln -s cfe-${LLVM_VERSION}.src clang

DIR=lldb-${LLVM_VERSION}.src
if [ ! -d ${DIR} ] ; then
  tar -xzf ${DIR}.tar.gz
fi
if [ -h lldb ] ; then
  rm lldb
fi
ln -s lldb-${LLVM_VERSION}.src lldb

cd ${LLVM_ROOT}/llvm-${LLVM_VERSION}.src/test

DIR=test-suite-${LLVM_VERSION}.src
if [ ! -d ${DIR} ] ; then
  tar -xzf ${DIR}.tar.gz
fi
if [ -h "test-suite" ] ; then
  rm test-suite
fi
ln -s test-suite-${LLVM_VERSION}.src test-suite

echo "Install http://thrysoee.dk/editline/ if necessary"

mkdir -p ${LLVM_ROOT}/build-${LLVM_VERSION}
cd ${LLVM_ROOT}/build-${LLVM_VERSION} && \
${LLVM_ROOT}/llvm-${LLVM_VERSION}.src/configure \
--enable-optimized \
--enable-cxx11 \
--with-gcc-toolchain=${GCC_DIR} \
--enable-targets=${TARGET} \
--prefix=${LLVM_ROOT}/clang-${LLVM_VERSION} \
CPPFLAGS="-I$HOME/LLVM/deps/include" \
LDFLAGS="-L$HOME/LLVM/deps/lib" && \
make -j32 && make install

Heads

This is not even close to complete.

cd $LLVMROOT/llvm && \
git remote update && \
cd $LLVMROOT/llvm/tools/clang && \
git remote update && \
cd $LLVMROOT/llvm/tools/polly && \
git remote update

./checkout_cloog.sh $LLVMROOT/cloog-isl_for_polly