SD TIMES BLOG
ahandy

What's new in LLVM 3.0?

by Alex Handy 12/07/2011 02:20 PM EST

Last week, while we were all recovering from turkey-induced narcolepsy, the LLVM team released version 3.0. There's a lot going on in this compiler and tool collection, so I'll let the change-log speak for itself. You can read the full release notes here. Pasted from here:

LLVM 3.0 includes several major changes and big features:

  • llvm-gcc is no longer supported, and not included in the release. We recommend switching to Clang or DragonEgg.
  • The linear scan register allocator has been replaced with a new "greedy" register allocator, enabling live range splitting and many other optimizations that lead to better code quality. Please see its blog post or its talk at the Developer Meeting for more information.
  • LLVM IR now includes full support for atomics memory operations intended to support the C++'11 and C'1x memory models. This includes atomic load and store, compare and exchange, and read/modify/write instructions as well as a full set of memory ordering constraints. Please see the Atomics Guide for more information.
  • The LLVM IR exception handling representation has been redesigned and reimplemented, making it more elegant, fixing a huge number of bugs, and enabling inlining and other optimizations. Please see its blog post and the Exception Handling documentation for more information.
  • The LLVM IR Type system has been redesigned and reimplemented, making it faster and solving some long-standing problems. Please see its blog post for more information.
  • The MIPS backend has made major leaps in this release, going from an experimental target to being virtually production quality and supporting a wide variety of MIPS subtargets. See the MIPS section below for more information.
  • The optimizer and code generator now supports gprof and gcov-style coverage and profiling information, and includes a new llvm-cov tool (but also works with gcov). Clang exposes coverage and profiling through GCC-compatible command line options.

If you're already an LLVM user or developer with out-of-tree changes based on LLVM 2.9, this section lists some "gotchas" that you may run into upgrading from the previous release.

  • LLVM 3.0 removes support for reading LLVM 2.8 and earlier files, and LLVM 3.1 will eliminate support for reading LLVM 2.9 files. Going forward, we aim for all future versions of LLVM to read bitcode files and .ll files produced by LLVM 3.0.
  • Tablegen has been split into a library, allowing the clang tblgen pieces to now live in the clang tree. The llvm version has been renamed to llvm-tblgen instead of tblgen.
  • The LLVMC meta compiler driver was removed.
  • The unused PostOrder Dominator Frontiers and LowerSetJmp passes were removed.
  • The old TailDup pass was not used in the standard pipeline and was unable to update ssa form, so it has been removed.
  • The syntax of volatile loads and stores in IR has been changed to "load volatile"/"store volatile". The old syntax ("volatile load"/"volatile store") is still accepted, but is now considered deprecated and will be removed in 3.1.
  • llvm-gcc's frontend tests have been removed from llvm/test/Frontend*, sunk into the clang and dragonegg testsuites.
  • The old atomic intrinsics (llvm.memory.barrier and llvm.atomic.*) are now gone. Please use the new atomic instructions, described in the atomics guide.
  • LLVM's configure script doesn't depend on llvm-gcc anymore, eliminating a strange circular dependence between projects.

Optimizers:

In addition to many minor performance tweaks and bug fixes, this release includes a few major enhancements and additions to the optimizers:

  • The pass manager now has an extension API that allows front-ends and plugins to insert their own optimizations in the well-known places in the standard pass optimization pipeline.
  • Information about branch probability and basic block frequency is now available within LLVM, based on a combination of static branch prediction heuristics and __builtin_expect calls. That information is currently used for register spill placement and if-conversion, with additional optimizations planned for future releases. The same framework is intended for eventual use with profile-guided optimization.
  • The "-indvars" induction variable simplification pass only modifies induction variables when profitable. Sign and zero extension elimination, linear function test replacement, loop unrolling, and other simplifications that require induction variable analysis have been generalized so they no longer require loops to be rewritten into canonical form prior to optimization. This new design preserves more IR level information, avoids undoing earlier loop optimizations (particularly hand-optimized loops), and no longer requires the code generator to reconstruct loops into an optimal form - an intractable problem.
  • LLVM now includes a pass to optimize retain/release calls for the Automatic Reference Counting (ARC) Objective-C language feature (in lib/Transforms/Scalar/ObjCARC.cpp). It is a decent example of implementing a source-language-specific optimization in LLVM.

Currently rated 1.5 by 63 people

  • Currently 1.47619/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Share this link: http://www.sdtimes.com/blog/1914

Tags: , , , , , ,

apple | LLVM

Comments

Add comment


 
 

biuquote
  • Comment




 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
MAY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Why we leave
Ten reasons good workers leave their jobs, plus a few suggestions for retaining them.
05/22/2012 06:14 PM EST

Creation
To write better software, cultivate your ability to be creative.
05/19/2012 07:40 PM EST

Slick...but who needs it?
compilr.com is a well-designed site and the folks behind it seem to have their heart in the right place. But...who needs it?
05/16/2012 12:45 PM EST

How to be a better software developer
Want to be a better developer? You won't get there by mastering an interesting language or learning a new set of APIs.
05/14/2012 12:18 PM EST

Wooing Galatea
Do yourself a favor and check out Galatea 2.2, a wonderful book by novelist Richard Powers.
05/12/2012 07:05 PM EST

The world as story
An artificial-intelligence system at Carnegie Mellon seeks to understand the world by making statements about it.
05/10/2012 06:39 AM EST

 

Events calendar tab
6/3/2012 to 6/7/2012
Orlando
IBM Rational

6/10/2012 to 6/15/2012
Las Vegas
SQE

6/10/2012 to 6/15/2012
Las Vegas
SQE

6/11/2012 to 6/14/2012
Bellevue, Wash.
AMD

6/11/2012 to 6/14/2012
Orlando
Microsoft