LLVM Project News and Details from the Trenches

Thursday, December 23, 2010

LLVM Developer Meeting 2010

The 2010 edition of the LLVM Developer's Meeting has come and gone, and it was a great event. It featured 17 great talks, several BOF sessions, and lots of informal discussions between all sorts of people interested in LLVM and its subprojects. Lang Hames wrote up a great summary of his experience at the meeting.

Unfortunately, there was more people who wanted to attend than we were able to accomodate, but fortunately the slides and videos of all the talks are available the web page. Many thanks go our to our sponsors: Apple, QuIC, Google, Qualcomm.

Happy holidays,

-Chris

Tuesday, September 7, 2010

LLVM in ClamAV

New in version 0.96, the ClamAV antivirus system extends its internal bytecode interpreter to support an LLVM JIT compiler. This JIT compiler allows for improved execution speeds, but also provides the ability to write virus checks directly in C code. For more details, see the Sourcefire Vulnerability Research Team's Blog.

-Chris

Tuesday, June 29, 2010

TCE project: Co-design of application-specific processors with LLVM-based compilation support

TTA-based Codesign Environment (TCE) is an application-specific instruction-set processor (ASIP) design toolset developed in Tampere University of Technology in several research projects since 2003. This blog post introduces the project and how LLVM is used in it to provide high-level language compiler support for the designed ASIPs.

Tuesday, June 8, 2010

New "lldb" Debugger

I'm happy to announce a great new subproject of LLVM: LLDB. LLDB is a modern debugger infrastructure which is built (like the rest of LLVM) as a series of modular and reusable libraries. LLDB builds on existing LLVM technologies like the enhanced disassembler APIs, the Clang ASTs and expression parser, the LLVM code generator and JIT compiler.

While still in early development, LLDB supports basic command line debugging scenarios on the Mac, is scriptable, and has great support for multithreaded debugging. LLDB is already much faster than GDB when debugging large programs, and has the promise to provide a much better user experience (particularly for C++ programmers). We are excited to see the new platforms, new features, and enhancements that the broader LLVM community is interested in.

If you'd like to try out LLDB and participate in its development, please visit http://lldb.llvm.org/ and consider signing up for the lldb-dev and lldb-commits mailing lists.

-Chris and the LLDB Team

Monday, June 7, 2010

LLVM receives first ever SIGPLAN Software Systems Award

Today the ACM announced that Chris Lattner and the LLVM Project are the recipient of the Programming Languages Software Award.

This award recognizes the impact that LLVM has had on the compiler research community, which can be seen in the large number of research publications using LLVM and the number of compiler courses that are using LLVM to teach compiler construction and optimization techniques. As part of this award, the ACM is donating $2500 to the LLVM project.

Thursday, May 20, 2010

Clang++ Builds Boost!

Boost is a collection of open-source, peer-reviewed C++ libraries that's well-known for having many good utility components for C++ programmers. It's also well-known for using bleeding-edge C++ techniques, such as extensive template and preprocessor metaprogramming, that have pushed many C++ compilers beyond their breaking point. Beyond just being a library, Boost has become a benchmark and a selling point for C++ compilers: is your compiler standards-confomant enough to build Boost?

Clang is.

Monday, May 17, 2010

The Glasgow Haskell Compiler and LLVM

If you read the LLVM 2.7 release notes carefully you would have noticed that one of the new external users is the Glasgow Haskell Compiler (GHC). As the author of the LLVM backend for GHC, I have been invited to write a post detailing the design of the backend and my experiences with using LLVM. This is that post :).

Tuesday, May 11, 2010

New "libc++" C++ Standard Library

I'm happy to announce a new subproject of LLVM: "libc++". libc++ is an implementation of the C++ Standard Library, with a focus on standards compliance, highly efficient generated code, and with an aim to support C++'0x when the standard is ratified. libc++ is written and maintained by Howard Hinnant, but we look forward to contributions from the LLVM community.

libc++ is approximately 85% complete at this point (including C++'0x features), and while it is intended to support and complement the Clang++ compiler, it can be ported to work with a broad variety of different C++ compilers. For more information, see the http://libcxx.llvm.org web page.

-Chris

Wednesday, April 14, 2010

Extensible Metadata in LLVM IR

A common request by front-end authors is to be able to add some sort of metadata to LLVM IR. This metadata could be used to influence language-specific optimization passes (for example, Type Based Alias Analysis in C), tag information for a custom code generator, or pass through information to link time optimization. LLVM 2.7 provides first-class support for this, and has switched debug information over to use it (improving debug info!).

While the details of this feature can be found in the LLVM Language Reference manual, sometimes it is hard to distill the big picture from the low-level details. This post tries to fill the gap by explaining some history, motivation and example use cases for this new LLVM 2.7 feature.

This post was written by Devang Patel and myself.

Friday, April 9, 2010

Intro to the LLVM MC Project

The LLVM Machine Code (aka MC) sub-project of LLVM was created to solve a number of problems in the realm of assembly, disassembly, object file format handling, and a number of other related areas that CPU instruction-set level tools work in. It is a sub-project of LLVM which provides it with a number of advantages over other compilers that do not have tightly integrated assembly-level tools.

This blog post talks about how the MC project evolved, describes a few different aspects of it , talks about the improvements/capabilities it brings to LLVM, and finishes off with the current status of the project.

Wednesday, April 7, 2010

ARM Advanced SIMD (NEON) Intrinsics and Types in LLVM

LLVM now supports all the intrinsic functions defined by ARM for the Advanced SIMD (aka "NEON") instruction set, but if you are migrating from GCC to LLVM, there are some implementation differences that you may encounter. LLVM follows ARM's specification of the standard NEON types more closely than GCC. It is also more strict about checking types of arguments to the NEON intrinsics.


This post describes the NEON-related differences between LLVM and GCC and gives a few examples of how to adapt your code to work with LLVM.


What's wrong with this code?

A user on IRC sent me this interesting KLEE example today, which I thought was cute enough I should post it.

If you aren't familiar with it, KLEE is a tool for symbolic execution of LLVM code. It is way too complicated to explain here, but for the purposes of this example all you need to know is that it tries to explore all possible paths through a program.


Monday, April 5, 2010

Amazing feats of Clang Error Recovery

In addition to parsing and generating machine code for your source files when valid, a compiler frontend's job is also to detect invalid code and give you a hint that explains what is wrong so you can fix the problem. The bug could either be straight-up invalid (an error) or could just be something that is legal but looks really dubious (a warning). These errors and warnings are known as compiler 'diagnostics', and Clang aims to go above and beyond the call of duty to provide a really amazing experience.

After the break, we show some examples of areas where Clang tries particularly hard. For other examples, the Clang web page also has a page on diagnostics and Doug showed how Clang diagnoses two-phase name lookup issues in a prior blog post.

Update: Other people are starting to compare their favorite compiler. Here's the OpenVMS Compiler. Email Chris if you have a comparison you want posted.

Секреты восстановления (Russian Translation)  provided by Softdroid Recovery.

Sunday, February 21, 2010

Dragonegg Successfully Self-Hosts!

The dragonegg GCC plugin can host itself! Dragonegg lets you use the LLVM optimizers with GCC-4.5, much like llvm-gcc, but unlike llvm-gcc does not involve modifying GCC, thanks to the new GCC plugin infrastructure (currently one small patch is required). We built all of GCC-4.5, LLVM and dragonegg with dragonegg, then used the resulting binaries to build them all again. Why? Because we love to build! And because this was a great way of checking that nothing was miscompiled. The final dragonegg plugin was fully functional, successfully passing the entire dragonegg test suite.

Thursday, February 4, 2010

Clang Successfully Self-Hosts!

Today, Clang completed its first complete self-host! We built all of LLVM and Clang with Clang (over 550k lines of C++ code). The resulting binaries passed all of Clang and LLVM's regression test suites, and the Clang-built Clang could then build all of LLVM and Clang again. The third-stage Clang was also fully-functional, completing the bootstrap.

Congratulations to all of the Clang developers on this amazing achievement!

Wednesday, January 6, 2010

The x86 Disassembler

Disassemblers make binary analysis work. With a reliable disassembler, you can solve high-level problems like tracing back through a program's call stack or analyzing sample-based profiles to low-level problems like figuring out how your compiler unrolled a tight floating-point loop or what advantages declaring a variable const actually had at the other end of the optimization chain. A reliable disassembler, which takes sequences of bytes and prints human-readable instruction mnemonics, is a crucial part of any development platform. You're about to go on a whirlwind tour of the LLVM disassembler: why one should exist, what's great about this one, and how you can use it.

Sunday, January 3, 2010

Address of Label and Indirect Branches in LLVM IR

The GCC Compiler supports a useful "Label as Values" extension, which allows code to take the address of a label and then later do an unconditional branch to an address specified as a void*. This extension is particularly useful for building efficient interpreters.

LLVM has long supported this extension by lowering it to a "correct" but extremely inefficient form. New in LLVM 2.7 is IR support for taking the address of a label and jumping to it later, which allows implementing this extension much more efficiently. This post describes this new LLVM IR feature and how it works.