-
-
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
Conversation
@kulibali does this work without the workarounds in llvm 4 and 5 support? |
@kulibali do you know how to add support for CI testing of LLVM 6? |
I haven't done anything on Linux yet, so I haven't tested the workaround or CI for Linux yet. The single AppVeyor failure seems spurious. I'll look at Linux, including CI, today. |
Ok, I have copied the CI configuration to make 6.0.0 happen; if I understand it correctly, someone will have to make a container for LLVM 6? Someone who knows Docker much better than me, ideally. One caveat: LLVM seems to not have generated a binary tarball for Ubuntu 16.04: http://releases.llvm.org/6.0.0/ |
@kulibali i think either @jemc or i could create the container for you. and you could update the circleci config to test with 6 as well. Using Ubuntu 16.04 isnt a requirement for setting up the CI. If you check, you'll see we use different uses of Ubuntu for the various LLVM versions. https://github.com/ponylang/ponyc/tree/master/.ci-dockerfiles |
.travis_script.bash
Outdated
|
||
export CC1=clang-6.0 | ||
export CXX1=clang++-6.0 | ||
#echo "Running LLVM 5.0 config=debug build..." |
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.
you can ditch these commented out lines
Hmm, I thought I had made and pushed a Docker image for LLVM 6; it seems I didn't do it right. |
It looks like the docker image you built may be broken with an owner id issue, as noted by CircleCI. I'm going to try building it myself to see if it resolves the issue. |
The image also was broken when I built it. I figured out last night that the LLVM archive seems to have been built with a "high" UID/GID, and when extracting tar archives as the |
@kulibali - I was able to create (last night) and upload (this morning) a working image, using the following 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 So I think Linux CI is passing now. The difference was using |
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 |
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
// 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 comment
The 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 comment
The 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 comment
The 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.
It looks like this just needs some OSX attention now. |
Here's the error from the Travis OSX build:
|
I see a warning for LLVM 5 in the build log, so I think that LLVM 5 is getting installed instead of 6: |
Yes. We do all the builds on the same OSX instances. We install the
different versions one at a time, testing each as we go.
…On Wed, Apr 4, 2018, 4:44 PM Gordon Tisher ***@***.***> wrote:
I see a warning for LLVM 5 in the build log, so I think that LLVM 5 is
getting installed instead of 6: Makefile:266: WARNING: LLVM 5 support is
experimental and may result in decreased performance or crashes
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2595 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAL0PH5lyOfgg5Nl5-itUFKQmZEVVjm_ks5tlTCTgaJpZM4Slh57>
.
|
I also just ran into the JITDefault problem that @jemc found. I looked at the llvm sources and found |
Thanks, @winksaville! So, based on that change, I think what's needed should be something like this: #if PONY_LLVM < 600
CodeModel::Model model = jit ? CodeModel::JITDefault : CodeModel::Default;
TargetMachine* m = t->createTargetMachine(opt->triple, opt->cpu,
opt->features, options, reloc, model, opt_level);
#else
CodeModel::Model model = jit ? CodeModel::Large : CodeModel::Small;
TargetMachine* m = t->createTargetMachine(opt->triple, opt->cpu,
opt->features, options, reloc, model, opt_level, jit);
#end |
\cc @Praetonus for confirmation on the small/large choice I made there with respect to the JIT... |
That code is in |
The change suggested by @jemc looks correct to me, but in case the default code models change in future LLVM versions, I think we should rather do something like this: TargetMachine* m = t->createTargetMachine(opt->triple, opt->cpu,
opt->features, options, reloc, llvm::None, opt_level, jit); With a |
This change adds experimental support for LLVM 6.0.0 and removes support for 4.0.1. The change still includes the workaround in the `Heap2Stack` optimization pass that can cause performance degradation (see ponylang#2371).
This PR includes build system and code changes to support LLVM 6.0.0.