LLVM Project News and Details from the Trenches

Monday, July 21, 2014

LLVM Weekly - #29, Jul 21st 2014

Welcome to the twenty-ninth issue of LLVM Weekly, a weekly newsletter (published every Monday) covering developments in LLVM, Clang, and related projects.LLVM Weekly is brought to you by Alex Bradbury.Subscribe to future issues at http://llvmweekly.org and pass it on to anyone else you think may be interested. Please send any tips or feedback to asb@asbradbury.org, or @llvmweekly or @asbradbury on Twitter.

This is a special extended issue which I'm choosing to subtitle "LLVM Weekly visits the GNU Tools Cauldron". The event took place over the weekend and had a wide range of interesting talks. You can find my notes at the end of this newsletter. Talks were recorded and the videos should be made available in the next month or two.

The canonical home for this issue can be found here at llvmweekly.org.

Wednesday, July 16, 2014

FTL: WebKit’s LLVM based JIT

Over the past year, the WebKit project made tremendous progress on the ability to optimize JavaScript applications. A major part of that effort was the introduction of the Fourth Tier LLVM (FTL) JIT. The Fourth Tier JIT targets long-running JavaScript content and performs a level of optimization beyond WebKit's interpreter, baseline JIT, and high-level optimizing JIT. See the FTL Optimization Strategy section below for more on WebKit's tiered optimizations. The engineering advancements within WebKit that made the FTL possible were described by Filip Pizlo in the Surfin' Safari Blog post, Introducing the WebKit FTL JIT. On April 29, 2014, the WebKit team enabled FTL by default on trunk: r167958.

This achievement also represents a significant milestone for the LLVM community. FTL makes it clear that LLVM can be used to accelerate a dynamically type checked languages in a competitive production environment. This in itself is a tremendous success story and shows the advantage of the highly modular and flexible design of LLVM. It is the first time that the LLVM infrastructure has supported self-modifying code, and the first time profile guided information has been used inside the LLVM JIT. Even though this project pioneered new territory for LLVM, it was in no way an academic exercise. To be successful, FTL must perform at least as well as non-FTL JavaScript engines in use today across a range of workloads without compromising reliability. This post describes the technical aspects of that accomplishment that relate to LLVM and future opportunities for LLVM to improve JIT compilation and the LLVM infrastructure overall.

Read on for more information.

Monday, July 14, 2014

LLVM Weekly - #28, Jul 14th 2014

Welcome to the twenty-eighth issue of LLVM Weekly, a weekly newsletter (published every Monday) covering developments in LLVM, Clang, and related projects. LLVM Weekly is brought to you by Alex Bradbury.Subscribe to future issues at http://llvmweekly.org and pass it on to anyone else you think may be interested. Please send any tips or feedback to asb@asbradbury.org, or @llvmweekly or @asbradbury on Twitter.

I'll be at the GNU Tools Cauldron 2014 next weekend, being held at the University of Cambridge Computer Laboratory (which handily is also where I work). If you're there, do say hi.

The canonical home for this issue can be found here at llvmweekly.org.

Monday, July 7, 2014

Clang/LLVM on Windows Update

It’s time for an update on Clang’s support for building native Windows programs, compatible with Visual C++!  We’ve been working hard over the last few months and have improved the toolchain in a variety of ways.  All C++ features aside from debug info and exceptions should work well.  This link provide more specific details.  In February we reached an exciting milestone that we can self-host Clang and LLVM using clang-cl (without fallback), and both projects  pass all of their tests!  Additionally both Chrome and Firefox now compile successfully with fallback!  Here are some of the highlights of recent improvements:


Microsoft compatible record layout is done!  It’s been thoroughly fuzz tested and supports all Microsoft specific components such as virtual base table pointers, vtordisps, __declspec(align) and #pragma pack.  This turned out to be a major effort due to subtle interactions between various features.  For example, __declspec(align) and #pragma pack behave in an analogous manner to the gcc variants, but interact with each other in a different manner. Each version of Visual Studio changes the ABI slightly.  As of today clang-cl is layout compatible with VS2013.


Clang now supports all of the calling conventions used up to VS2012.  VS2013 added some new ones that we haven’t implemented yet.  One of the other major compatibility challenges we overcame was passing C++ objects by value on 32-bit x86.  Prior to this effort, LLVM modeled all outgoing arguments as SSA values, making it impossible to take the address of an argument to a call.  It turns out that on Windows C++ objects passed by value are constructed directly into the argument memory used for the function call.  Achieving 100% compatibility in this area required making fundamental changes to LLVM IR to allow us to compute this address.


Most recently support for run time type information (RTTI) was completed.  With RTTI support, a larger set of programs and libraries (for example ICU) compile without fallback and dynamic_cast and typeid both work.  RTTI support also brings along support for std::function.  We also recently added support for lambdas so you can enjoy all of the C++11 functional goodness!

We invite you to try it out for yourself and, as always, we encourage everyone to file bugs!

LLVM Weekly - #27, Jul 7th 2014

Welcome to the twenty-seventh issue of LLVM Weekly, a weekly newsletter (published every Monday) covering developments in LLVM, Clang, and related projects.LLVM Weekly is brought to you by Alex Bradbury.Subscribe to future issues at http://llvmweekly.org and pass it on to anyone else you think may be interested. Please send any tips or feedback to asb@asbradbury.org, or @llvmweekly or @asbradbury on Twitter.

The canonical home for this issue can be found here at llvmweekly.org.