-
-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update with experimental support for LLVM 6.0.0 #2595
Changes from all commits
ebfac97
ec54837
4c8dae6
1743778
f925fc7
730575d
70beb0d
97beea7
59175ea
5fb8c55
82f2fd6
0e22fd0
05e4a1e
bc4e98d
a6ae93a
7a4bd1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM ubuntu:14.04 | ||
|
||
ENV LLVM_VERSION 6.0.0 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
apt-transport-https \ | ||
build-essential \ | ||
g++ \ | ||
git \ | ||
libncurses5-dev \ | ||
libssl-dev \ | ||
make \ | ||
wget \ | ||
xz-utils \ | ||
zlib1g-dev \ | ||
&& cd /tmp \ | ||
&& wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2 \ | ||
&& tar xjvf pcre2-10.21.tar.bz2 \ | ||
&& cd pcre2-10.21 \ | ||
&& ./configure --prefix=/usr \ | ||
&& make \ | ||
&& sudo make install \ | ||
&& cd / \ | ||
&& rm -rf /tmp/pcre* \ | ||
&& wget -O - http://releases.llvm.org/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz \ | ||
| tar xJf - --no-same-owner --strip-components 1 -C /usr/local/ clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Build image | ||
|
||
```bash | ||
docker build -t ponylang/ponyc-ci:llvm-6.0.0 . | ||
``` | ||
|
||
# Run image to test | ||
|
||
Will get you a bash shell in the image to try cloning Pony into where you can test a build to make sure everything will work before pushing | ||
|
||
```bash | ||
docker run --name ponyc-ci-llvm-600 --rm -i -t ponylang/ponyc-ci:llvm-6.0.0 bash | ||
``` | ||
|
||
# Push to dockerhub | ||
|
||
You'll need credentials for the ponylang dockerhub account. Talk to @jemc or @seantallen for access | ||
|
||
```bash | ||
docker push ponylang/ponyc-ci:llvm-6.0.0 | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,24 +49,6 @@ case "${TRAVIS_OS_NAME}" in | |
make clean | ||
brew uninstall [email protected] | ||
|
||
# 4.0.x | ||
brew install llvm@4 | ||
brew link --overwrite --force llvm@4 | ||
ln -fs "$(which llvm-config)" llvmsym/llvm-config-4.0 | ||
ln -fs "$(which clang++)" llvmsym/clang++-4.0 | ||
|
||
export CC1=clang-4.0 | ||
export CXX1=clang++-4.0 | ||
#echo "Running LLVM 4.0 config=debug build..." | ||
#export config=debug | ||
#ponyc-test | ||
echo "Running LLVM 4.0 config=release build..." | ||
export config=release | ||
ponyc-test | ||
|
||
make clean | ||
brew uninstall llvm@4 | ||
|
||
# 5.0.x | ||
brew install llvm@5 | ||
brew link --overwrite --force llvm@5 | ||
|
@@ -75,15 +57,31 @@ case "${TRAVIS_OS_NAME}" in | |
|
||
export CC1=clang-5.0 | ||
export CXX1=clang++-5.0 | ||
#echo "Running LLVM 5.0 config=debug build..." | ||
#export config=debug | ||
#ponyc-test | ||
echo "Running LLVM 5.0 config=release build..." | ||
export config=release | ||
ponyc-test | ||
|
||
make clean | ||
brew uninstall llvm@5 | ||
|
||
# 6.0.x | ||
# There is no llvm@6 package right now, so this will break once LLVM 7 | ||
# is released. Hopefully when they do that there will be a llvm@6 package | ||
# at which point both `brew install llvm` and `brew uninstall llvm` | ||
# should be updated to replace `llvm` with `llvm@6` | ||
brew install llvm | ||
brew link --overwrite --force llvm | ||
ln -fs "$(which llvm-config)" llvmsym/llvm-config-6.0 | ||
ln -fs "$(which clang++)" llvmsym/clang++-6.0 | ||
|
||
export CC1=clang-6.0 | ||
export CXX1=clang++-6.0 | ||
echo "Running LLVM 6.0 config=release build..." | ||
export config=release | ||
ponyc-test | ||
|
||
make clean | ||
brew uninstall llvm | ||
fi | ||
;; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,6 +205,8 @@ endif | |
ifndef LLVM_CONFIG | ||
ifneq (,$(shell which /usr/local/opt/llvm/bin/llvm-config 2> /dev/null)) | ||
LLVM_CONFIG = /usr/local/opt/llvm/bin/llvm-config | ||
else ifneq (,$(shell which llvm-config-6.0 2> /dev/null)) | ||
LLVM_CONFIG = llvm-config-6.0 | ||
else ifneq (,$(shell which llvm-config-3.9 2> /dev/null)) | ||
LLVM_CONFIG = llvm-config-3.9 | ||
else ifneq (,$(shell which /usr/local/opt/[email protected]/bin/llvm-config 2> /dev/null)) | ||
|
@@ -261,6 +263,8 @@ else ifeq ($(llvm_version),5.0.0) | |
$(warning WARNING: LLVM 5 support is experimental and may result in decreased performance or crashes) | ||
else ifeq ($(llvm_version),5.0.1) | ||
$(warning WARNING: LLVM 5 support is experimental and may result in decreased performance or crashes) | ||
else ifeq ($(llvm_version),6.0.0) | ||
$(warning WARNING: LLVM 6 support is experimental and may result in decreased performance or crashes) | ||
else | ||
$(warning WARNING: Unsupported LLVM version: $(llvm_version)) | ||
$(warning Please use LLVM 3.9.1) | ||
|
@@ -615,12 +619,12 @@ define CONFIGURE_COMPILER | |
compiler := $(CC) | ||
flags := $(ALL_CFLAGS) $(CFLAGS) | ||
endif | ||
|
||
ifeq ($(suffix $(1)),.bc) | ||
compiler := $(CC) | ||
flags := $(ALL_CFLAGS) $(CFLAGS) | ||
endif | ||
|
||
ifeq ($(suffix $(1)),.ll) | ||
compiler := $(CC) | ||
flags := $(ALL_CFLAGS) $(CFLAGS) -Wno-override-module | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,10 @@ | |
#include <llvm/Transforms/Utils/Cloning.h> | ||
#include <llvm/ADT/SmallSet.h> | ||
|
||
#if PONY_LLVM >= 600 | ||
#include <llvm-c/DebugInfo.h> | ||
#endif | ||
|
||
#include "../../libponyrt/mem/heap.h" | ||
#include "ponyassert.h" | ||
|
||
|
@@ -87,6 +91,15 @@ static void print_transform(compile_t* c, Instruction* i, const char* s) | |
} | ||
} | ||
|
||
// TODO: remove for 6.0.1: https://reviews.llvm.org/D44140 | ||
#if PONY_LLVM == 600 | ||
PONY_EXTERN_C_BEGIN | ||
void LLVMInitializeInstCombine_Pony(LLVMPassRegistryRef R) { | ||
initializeInstructionCombiningPassPass(*unwrap(R)); | ||
} | ||
PONY_EXTERN_C_END | ||
#endif | ||
|
||
class HeapToStack : public FunctionPass | ||
{ | ||
public: | ||
|
@@ -302,9 +315,9 @@ class HeapToStack : public FunctionPass | |
} | ||
|
||
case Instruction::Load: | ||
// This is a workaround for a problem with LLVM 4 & 5 on *nix when | ||
// This is a workaround for a problem with LLVM 4 & 5 on *nix when | ||
// hoisting loads (see #2303, #2061, #1592). | ||
// TODO: figure out the real reason LLVM 4 and 5 produce bad code | ||
// TODO: figure out the real reason LLVM 4 and 5 produce bad code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we figured out whether LLVM 6 also produces this bad code? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, there are still problems with LLVM 6 on Linux, but different from 4 & 5. @Praetonus was going to look at it again in his copious free time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I turned on the workaround again for the time being, which is why the CI tests are passing. |
||
// when hoisting stack allocated loads. | ||
#if PONY_LLVM >= 400 && !defined(_MSC_VER) | ||
// fall through | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is no longer true? https://github.com/Homebrew/homebrew-core/blob/cd015553ae9c25389f4e35f8a9a9aef0ac2cc733/Aliases/llvm%406
Is this still true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes