LLVM Project News and Details from the Trenches

Monday, December 29, 2014

LLVM Weekly - #52, Dec 29th 2014

Welcome to the fifty-second 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 issue marks the end of one full year of LLVM Weekly. It's a little shorter than usual as the frenetic pace of LLVM/Clang development has slowed over the holiday period. Surprising even to me is that we managed to make it full all 52 weeks with an issue every Monday as promised. This requires a non-trivial amount of time each week (2-3+ hours), but I am intending to keep it going into 2015. I'd like to give a big thank you to everyone who's said hi at a conference, sent in corrections or tips on content, or just sent a random thank you. It's been very helpful in motivation. I don't currently intend to change anything about the structure or content of each issue for next year, but if you have any ideas then please let me know.

I can't make it to 31C3 due to the awkward timing of the event, but do let me know if there are any LLVM/Clang related talks worth sharing. There was a talk about Code Pointer Integrity which has previously been covered in LLVM Weekly and is working towards upstreaming. The video is here. If you're interested in lowRISC and at 31C3, Bunnie is leading a discussion about it at 2pm on Monday (today).

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

Monday, December 22, 2014

LLVM Weekly - #51, Dec 22nd 2014

Welcome to the fifty-first 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.

Last week as part of the lowRISC project I was involved in sharing our plans for tagged memory and 'minion' cores in the initial version. We've almost made it a full year of LLVM Weekly with no interruption of service!

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

Monday, December 15, 2014

LLVM Weekly - #50, Dec 15th 2014

Welcome to the fiftieth 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 MICRO-47 this week. If you're there do say hi, especially if you want to chat about LLVM or lowRISC/RISC-V.

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

Monday, December 8, 2014

LLVM Weekly - #49, Dec 8th 2014

Welcome to the forty-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.

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

Monday, December 1, 2014

LLVM Weekly - #48, Dec 1st 2014

Welcome to the forty-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.

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

Monday, November 24, 2014

Loop Vectorization: Diagnostics and Control

Loop vectorization was first introduced in LLVM 3.2 and turned on by default in LLVM 3.3. It has been discussed previously on this blog in 2012 and 2013, as well as at FOSDEM 2014, and at Apple's WWDC 2013. The LLVM loop vectorizer combines multiple iterations of a loop to improve performance. Modern processors can exploit the independence of the interleaved instructions using advanced hardware features, such as multiple execution units and out-of-order execution, to improve performance.

Unfortunately, when loop vectorization is not possible or profitable the loop is silently skipped. This is a problem for many applications that rely on the performance vectorization provides. Recent updates to LLVM provide command line arguments to help diagnose vectorization issues and new a pragma syntax for tuning loop vectorization, interleaving, and unrolling.

New Feature: Diagnostics Remarks

Diagnostic remarks provide the user with an insight into the behavior of the behavior of LLVM’s optimization passes including unrolling, interleaving, and vectorization. They are enabled using the Rpass command line arguments. Interleaving and vectorization diagnostic remarks are produced by specifying the ‘loop-vectorize’ pass. For example, specifying ‘-Rpass=loop-vectorize’ tells us the following loop was vectorized by 4 and interleaved by 2.

void test1(int *List, int Length) {
  int i = 0;
  while(i < Length) {
    List[i] = i*2;
    i++;
  }
}

clang -O3 -Rpass=loop-vectorize -S test1.c -o /dev/null

test1.c:4:5: remark: 
vectorized loop (vectorization factor: 4, unrolling interleave factor: 2)
    while(i < Length) {
    ^

Many loops cannot be vectorized including loops with complicated control flow, unvectorizable types, and unvectorizable calls. For example, to prove it is safe to vectorize the following loop we must prove that array ‘A’ is not an alias of array ‘B’. However, the bounds of array ‘A’ cannot be identified.

void test2(int *A, int *B, int Length) {
  for (int i = 0; i < Length; i++)
    A[B[i]]++;
}

clang -O3 -Rpass-analysis=loop-vectorize -S test2.c -o /dev/null

test2.c:3:5: remark:
loop not vectorized: cannot identify array bounds
    for (int i = 0; i < Length; i++)
    ^

Control flow and other unvectorizable statements are reported by the '-Rpass-analysis' command line argument. For example, many uses of ‘break’ and ‘switch’ are not vectorizable.

C/C++ Code -Rpass-analysis=loop-vectorize
for (int i = 0; i < Length; i++) {
  if (A[i] > 10.0)
    break;
  A[i] = 0;

}
control_flow.cpp:5:9: remark: loop not vectorized: loop control flow is not understood by vectorizer
    if (A[i] > 10.0)

        ^
for (int i = 0; i < Length; i++) {
  switch(A[i]) {
  case 0: B[i] = 1; break;
  case 1: B[i] = 2; break;
  default: B[i] = 3;
  }

}
no_switch.cpp:4:5: remark: loop not vectorized: loop contains a switch statement
    switch(A[i]) {

    ^

New Feature: Loop Pragma Directive

Explicitly control over the behavior of vectorization, interleaving and unrolling is necessary to fine tune the performance. For example, when compiling for size (-Os) it's a good idea to vectorize the hot loops of the application to improve performance. Vectorization, interleaving, and unrolling can be explicitly specified using the #pragma clang loop directive prior to any for, while, do-while, or c++11 range-based for loop. For example, the vectorization width and interleaving count is explicitly specified for the following loop using the loop pragma directive.

void test3(float *Vx, float *Vy, float *Ux, float *Uy, float *P, int Length) {
#pragma clang loop vectorize_width(4) interleave_count(4)
#pragma clang loop unroll(disable)
  for (int i = 0; i < Length; i++) {
    float A = Vx[i] * Ux[i];
    float B = A + Vy[i] * Uy[i];
    P[i] = B;
   }
}

clang -O3 -Rpass=loop-vectorize -S test3.c -o /dev/null

test3.c:5:5: remark:
vectorized loop (vectorization factor: 4, unrolling interleave factor: 4)
    for (int i = 0; i < Length; i++) {
    ^

Integer Constant Expressions

The options vectorize_width, interleave_count, and unroll_count take an integer constant expression. So it can be computed as in the example below.

template <int ArchWidth, int ExecutionUnits>
void test4(float *Vx, float *Vy, float *Ux, float *Uy, float *P, int Length) {
#pragma clang loop vectorize_width(ArchWidth)
#pragma clang loop interleave_count(ExecutionUnits * 4)
  for (int i = 0; i < Length; i++) {
    float A = Vx[i] * Ux[i];
    float B = A + Vy[i] * Uy[i];
    P[i] = B;
   }
}

void compute_test4(float *Vx, float *Vy, float *Ux, float *Uy, float *P, int Length) {
  const int arch_width = 4;
  const int exec_units = 2;
  test4<arch_width, exec_units>(Vx, Vy, Ux, Uy, P, Length);
}

clang -O3 -Rpass=loop-vectorize -S test4.cpp -o /dev/null

test4.cpp:6:5: remark:
vectorized loop (vectorization factor: 4, unrolling interleave factor: 8)
    for (int i = 0; i < Length; i++) {
    ^

Performance Warnings

Sometimes the loop transformation is not safe to perform. For example, vectorization fails due to the use of complex control flow. If vectorization is explicitly specified a warning message is produced to alert the programmer that the directive cannot be followed. For example, the following function which returns the last positive value in the loop, cannot be vectorized because the ‘last_positive_value’ variable is used outside the loop.

int test5(int *List, int Length) {
  int last_positive_index = 0;
  #pragma clang loop vectorize(enable)
  for (int i = 1; i < Length; i++) {
    if (List[i] > 0) {
      last_positive_index = i;
      continue;
    }
    List[i] = 0;
  }
  return last_positive_index;
}

clang -O3 -g -S test5.c -o /dev/null

test5.c:5:9: warning:
loop not vectorized: failed explicitly specified loop vectorization
    for (int i = 1; i < Length; i++) {
        ^

The debug option ‘-g’ allows the source line to be provided with the warning.

Conclusion

Diagnostic remarks and the loop pragma directive are two new features that are useful for feedback-directed-performance tuning. Special thanks to all of the people who contributed to the development of these features. Future work includes adding diagnostic remarks to the SLP vectorizer and an additional option for the loop pragma directive to declare the memory operations as safe to vectorize. Additional ideas for improvements are welcome.

LLVM Weekly - #47, Nov 24th 2014

Welcome to the forty-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.

Tuesday, November 18, 2014

LLVM Weekly - #46, Nov 17th 2014

Welcome to the forty-sixth 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.

Monday, November 10, 2014

LLVM Weekly - #45, Nov 10th 2014

Welcome to the forty-fifth 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.

Monday, November 3, 2014

LLVM Weekly - #44, Nov 3rd 2014

Welcome to the forty-fourth 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.

Monday, October 27, 2014

LLVM Weekly - #43, Oct 27th 2014

Welcome to the forty-third 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 week it's the LLVM Developers' Meeting in San Jose. Check out the schedule. Unfortunately I won't be there, so I'm looking forward to the slides and videos going online.

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

Monday, October 20, 2014

LLVM Weekly - #42, Oct 20th 2014

Welcome to the forty-second 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.

If you're local to London, you may be interested to know that I'll be talking about lowRISC at the Open Source Hardware User Group on Thursday.

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

Tuesday, October 14, 2014

LLVM Weekly - #41, Oct 13th 2014

Welcome to the forty-first 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've been in Munich for ORCONF this weekend. Slides from my talk about lowRISC are available here.

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

Monday, October 6, 2014

LLVM Weekly - #40, Oct 6th 2014

Welcome to the fortieth 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 in Munich next weekend for the OpenRISC conference where I'll be presenting on the lowRISC project to produce an open-source SoC. I'll be giving a similar talk in London at the Open Source Hardware User Group on 23rd October.

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

Monday, September 29, 2014

LLVM Weekly - #39, Sep 29th 2014

Welcome to the thirty-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.

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

Monday, September 22, 2014

LLVM Weekly - #38, Sep 22nd 2014

Welcome to the thirty-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've been at PyConUK this past weekend so I'm afraid it's another slightly shorter than normal issue. I've been talking about Pyland, a programming game that aims to teach children programming in Python (and of course, runs on Raspberry Pi).

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

Monday, September 15, 2014

LLVM Weekly - #37, Sep 15th 2014

Welcome to the thirty-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.

This week's issue comes to you from sunny Tenerife. Yes, my dedication to weekly LLVM updates is so great that I'm writing it on holiday. Enjoy! I'll also note that I'm at PyCon UK next week where I'll be presenting on the results of a project we had some interns working on over the summer creating a programming game for the Raspberry Pi.

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

Monday, September 8, 2014

LLVM Weekly - #36, Sep 8th 2014

Welcome to the thirty-sixth 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.

Monday, September 1, 2014

LLVM Weekly - #35, Sep 1st 2014

Welcome to the thirty-fifth 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.

As I mentioned in a previous issue, I am involved in the lowRISC projects to produce a fully open-source SoC. Just a quick reminder that we are hiring, and you have just over a week to get your application in.

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

Monday, August 25, 2014

LLVM Weekly - #34, Aug 25th 2014

Welcome to the thirty-fourth 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.

Monday, August 18, 2014

LLVM Weekly - #33, Aug 18th 2014

Welcome to the thirty-third 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.

Monday, August 11, 2014

LLVM Weekly - #32, Aug 11th 2014

Welcome to the thirty-second 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.

Some readers may be interested to know that lowRISC, a project to produce a fully open-source SoC started by a number of us at the University of Cambridge Computer Lab has been announced. We are hiring.

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

Monday, August 4, 2014

LLVM Weekly - #31, Aug 4th 2014

Welcome to the thirty-first 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.

Monday, July 28, 2014

LLVM Weekly - #30, Jul 28th 2014

Welcome to the thirtieth 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.

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.

Monday, June 30, 2014

LLVM Weekly - #26, Jun 30th 2014

Welcome to the twenty-sixth 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.

Monday, June 23, 2014

LLVM Weekly - #25, Jun 23rd 2014

Welcome to the twenty-fifth 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.

Monday, June 16, 2014

LLVM Weekly - #24, Jun 16th 2014

Welcome to the twenty-fourth 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.

Monday, June 9, 2014

LLVM Weekly - #23, Jun 9th 2014

Welcome to the twenty-third 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.

Monday, June 2, 2014

LLVM Weekly - #22, Jun 2nd 2014

Welcome to the twenty-second 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.

Last week I expressed worry about GMANE not updating. I'm happy to report that it's back to normal now. Some of my readers might be interested in my account of the neat Raspberry Pi-based projects I saw at Maker Faire Bay Area.

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

Monday, May 26, 2014

LLVM Weekly - #21, May 26th 2014

Welcome to the 21st 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'm back in the UK and mostly recovered from the ensuing jetlag. I am however disturbed that all mailing lists on GMANE don't seem to have been updated for the past week and have been unable to find any explanation of what is going on online. GMANE is an important and massively useful aggregrator and archiver of free software development lists and I really hope these are only temporary problems. For this issue, I have instead linked directly to the mailman archives at UIUC.

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

Monday, May 19, 2014

LLVM Weekly - #20, May 19th 2014

Welcome to the twentieth 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 week's issue is perhaps a little less thorough than normal. I've been in San Francisco most of the week for Maker Faire this weekend, where I was at the Raspberry Pi booth with some other Foundation members. As this issue goes out, I'll be enjoying my last day in SF before heading to the airport for the long flight home and the ensuing jetlag.

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

Monday, May 12, 2014

LLVM Weekly - #19, May 12th 2014

Welcome to the ninteenth 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'm flying out to San Francisco tomorrow and will be there for the Bay Area Maker Faire at the weekend with some other Raspberry Pi Foundation people. If you're around, be sure to say hi.

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

Friday, May 9, 2014

LLVM 3.4.1 Release

LLVM 3.4.1 has been released!  This is a bug-fix release that contains fixes for the AArch64, ARM, PowerPC, R600, and X86 targets as well as a number of other fixes in the core libraries.

The LLVM and Clang core libraries in this release are API and ABI compatible with LLVM 3.4, so projects that make use of the LLVM and Clang API and libraries will not need to make any changes in order to take advantage of the 3.4.1 release.

Bug-fix releases like this are very important for the project, because they help get critical fixes to users faster than the typical 6 month release cycle, and also make it easier for operating system distributors who in the past have had to track and apply bug fixes on their own.

A lot of work went into this release, and special thanks should be given to all the testers who helped to qualify the release:

Renato Golin
Sebastian Dreßler
Ben Pope
Arnaud Allard de Grandmaison
Erik Verbruggen
Hal Finkel
Nikola Smiljanic
Hans Wennborg
Sylvestre Ledru
David Fang

In addition there were a number community members who spent time tracking down bugs and helping to resolve merge conflicts in the 3.4 branch.  This is what made this release possible, so thanks to everyone
else who helped.

I would like to keep the trend of stable releases going to 3.5.x and beyond (Maybe even 3.4.2 if there is enough interest), but this can only be
done with the help of the community.  If you would like to help with the next stable release or even regular release, then the next time you see a proposed release schedule on the mailing list, let the release manager know you can help.  We can never have too many volunteers.

Thanks again to everyone who helped make this release possible.

-Tom





Monday, May 5, 2014

LLVM Weekly - #18, May 5th 2014

Welcome to the eighteenth 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'm going to be in the San Francisco area May 13th-20th with some other Raspberry Pi people. We'll be at Maker Faire Bay Area on the 17th and 18th. Let me know if there's anything else I should check out while over there.

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

Monday, April 28, 2014

LLVM Weekly - #17, Apr 28th 2014

Welcome to the 17th 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.

Last week I wondered why the GCC logo is a GNU leaping out of an egg. Thank you to everyone who wrote in to let me know it is a reference to EGCS. GCC was of course famously forked as EGCS which was later merged back in. Apparently this was pronounced by some as "eggs". Mystery solved.

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

Monday, April 21, 2014

LLVM Weekly - #16, Apr 21st 2014

Welcome to the 16th 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.

Apologies that last week's LLVM Weekly went out twice via email. Mailgun have the useful ability to schedule an email for the future, but when this is done incorrectly have no ability to cancel it via the API. Possibly there is no way for them to cancel it either, I have no way to know as my support ticket on the issue was never answered.

Seeing as it's Easter, does anybody know why GCC has a GNU breaking out of an egg as a logo?

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

Monday, April 14, 2014

LLVM Weekly - #15, Apr 14th 2014

Welcome to the 15th 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.

Monday, April 7, 2014

LLVM Weekly - #14, Apr 7th 2014

Welcome to the fourteenth 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.

There seems to have been a flood of LLVM-related news this week, hopefully I've managed to collect it all. If you're in London next week, you might be interested in attending my introductory LLVM talk on Wednesday. Abstract is here.

EuroLLVM is of course taking place on Monday and Tuesday of this week. Sadly I won't be in attendance. If anyone is blogging the event, please do send me links.

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

Thursday, April 3, 2014

The LLVM Foundation


The LLVM umbrella project has grown over the years into a vibrant community made up of many sub-projects, with hundreds of contributors.  The results of this project are used by millions of people every day.  Today, I'm happy to announce that we are taking the next big step, and forming a new, independent non-profit to represent the community interest.  "The LLVM Foundation" will allow us to:

 - Solve infrastructure problems.
 - Address financial challenges around the developer meetings and infrastructure expenses.
 - Deliver improved transparency into operational and policy matters
 - Provide a company-neutral organization to help ensure success well into the future.

We are working towards a goal of having this organization functioning by the end of the year, possibly sooner.

In terms of structure, we expect the foundation to be lean: an oversight board of volunteers and a dedicated administrator.  The expectations of this administrator will be to oversee long-overdue upgrades to our infrastructure (such as the web site design, bug database, mailing lists, etc), organize the US LLVM Developer Meeting, and drive the formation of the foundation itself.  We do not expect significant change to our developer policies (i.e. licensing & copyright).  Our system of domain-expert "code owners" will continue to drive the technical direction of their areas.  As an LLVM contributor, the biggest changes that you can expect to see are things operating more smoothly and infrastructure issues getting the attention they deserve.

Tanya Lattner has been spearheading the formation of the Foundation and has graciously agreed to take on the administrator role.  Tanya has been actively involved in LLVM since 2003.  Many of you know Tanya from her LLVM community involvement such as organizing the US LLVM Developer Meetings and management of the website and other infrastructure.  She implemented Swing Modulo Scheduling in LLVM for her Masters thesis at UIUC, served as the release manager from LLVM 1.7 through 2.7, and in a commercial setting she implemented LLVM based optimization tools and contributed to an LLVM-based OpenCL implementation.

We have also been quietly speaking with members of the community, working to select a diverse board of directors, that accurately reflects the community’s interests.  We looked to active members of the community, representing both academic and commercial interests, people from organizations that contribute to the developer meeting and testing infrastructure, and technical leads from some of the prominent LLVM sub-projects.  We sought diversity in the board, while trying to keep it small enough to be nimble.  The initial board of directors will be:

Vikram Adve
Chandler Carruth
Doug Gregor
David Kipping
Anton Korobeynikov
Chris Lattner
Tanya Lattner
Alex Rosenberg
I expect that there will be many questions and comments.  The foundation is intended to represent the interests of the community, so please send questions to the LLVMdev mailing list.  More information will be coming over the next few months as things progress.

-Chris

Monday, March 31, 2014

LLVM Weekly - #13, Mar 31st 2014

Welcome to the thirteenth 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.

Thanks in no small part to a mention on the Raspberry Pi blog, Learning Python with Raspberry Pi by myself and Ben Everard is at the time of writing #1 in the Programming books section on Amaon UK. Also, keep your eyes on the X-Dev London meetup page as I'm expecting to give an LLVM-related talk there on the 9th April, though it's not listed yet and is subject to change.

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

Monday, March 24, 2014

LLVM Weekly - #12, Mar 24th 2014

Welcome to the twelfth 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.

Monday, March 17, 2014

LLVM Weekly - #11, Mar 17th 2014

Welcome to the eleventh 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.

It seems an extra comma slipped in to my bio in Learning Python with Raspberry Pi (US) meaning rather than being described as a "compiler hacker, ...", I am a "compiler, hacker, Linux geek, and Free Software enthusiast". It's therefore official, I am a compiler. Presumably this makes me uniquely suited to writing LLVM Weekly.

Previously I've only linked to internship opportunities rather than job ads. I'd be interested in how readers feel about linking to job ads looking for someone with LLVM experience? Do let me know via email or Twitter.

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

Monday, March 10, 2014

LLVM Weekly - #10, Mar 10th 2014

Welcome to the tenth 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 week the book I authored in collaboration with Ben Everard, Learning Python with Raspberry Pi (Amazon US) is officially released.

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

Monday, March 3, 2014

LLVM Weekly - #9, Mar 3rd 2014

Welcome to the 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.

As well as growing another year older last week, I've also started publicising the book I authored with Ben Everard, Learning Python with Raspberry Pi (Amazon US) which should ship soon in paperback or is available right now for Kindle. Hopefully it should be available soon in DRM-free digital formats on oreilly.com. I will be putting more of my Raspberry Pi exploits and tutorials on muxup.com, so if that interests you follow @muxup.

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

Monday, February 24, 2014

LLVM Weekly - #8, Feb 24th 2014

Welcome to the 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 Raspberry Jamboree at the end of the week, so if you're going as well be sure to say hi.

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

Monday, February 17, 2014

LLVM Weekly - #7, Feb 17th 2014

Welcome to the 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.

As always, apologies if I didn't pick up your favourite mailing list discussion or commits. Do drop me a line if you think I'm missing something interesting. There haven't been that many external news stories or blog posts (that I've found) in the last week, but it's been a particularly busy week on the mailing lists with a whole bunch of interesting discussions or RFCs.

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

Monday, February 10, 2014

LLVM Weekly - #6, Feb 10th 2014

Welcome to the sixth 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've been keeping the @llvmweekly Twitter account updated throughout the week, so follow that if you want more frequent news updates.

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

Monday, February 3, 2014

LLVM Weekly - #5, Feb 3rd 2014

Welcome to the fifth 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've been keeping the @llvmweekly Twitter account updated throughout the week, so follow that if you want more frequent news updates.

I'm afraid my summary of mailing list activities is much less thorough than usual, as I've been rather busy this weekend both moving house and suffering from a cold. Do ping me if you think I've missed anything important.

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

Monday, January 27, 2014

LLVM Weekly - #4, Jan 27th 2014

Welcome to the fourth issue of LLVM Weekly, a weekly newsletter (published every Monday) covering developments in LLVM, Clang, and related projects. This marks the end of the first month of operation, here's to many more! 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've been keeping the @llvmweekly Twitter account updated throughout the week, so follow that if you want more frequent news updates.

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

Monday, January 20, 2014

LLVM Weekly - #3, Jan 20th 2014

Welcome to the third 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.

Monday, January 13, 2014

LLVM Weekly - #2, Jan 13th 2014

Welcome to the second issue of LLVM Weekly (and the first to appear on the LLVM blog). LLVM Weekly is a newsletter (published every Monday) covering developments in LLVM, Clang, and related projects. Thank you to everyone who has given positive feedback or suggestions, I'm planning in future editions to integrate some sort of statistics of git activity and contributions as well as activity on Bugzilla. 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.