Planet Clang

February 01, 2016

LLVM Blog

LLVM Weekly - #109, Feb 1st 2016

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

News and articles from around the web

The GNU Tools Cauldron 2016 has been announced for the 9th-11th of September 2016, in Hebden Bridge, UK.

The Sulong project has been announced. It is an LLVM IR interpreter using the Truffle framework and Graal on the JVM to support JIT compilation.

Ehsan Akhgari has posted an updated on building Firefox with clang-cl. It is now possible to build a complete Firefox with Clang without using the MSVC fallback once.

I've mentioned it down below in the list of notable commits, but it's worth calling out here too: the old autoconf build-system has now been removed from LLVM. 3.8 will be the last release to include it. Time to switch to CMake if you haven't already.

John Regehr gave a talk about undefined behaviour in LLVM at the Paris LLVM meetup, and you can find the slides here.

On the mailing lists

LLVM commits

  • The autoconf build system for LLVM has been removed. r258861.

  • The WebAssembly backend gained support for unaligned loads and stores. r258779.

  • LLVM's MCAsmSreamer will now always use .p2align rather than .align, because .align's behaviour can differ between targets. r258750.

  • Intrinsic IDs are now looked up by binary search rather than the previous more complex mechanism. This improves the compile time of Function.cpp. r258774.

  • TargetSelectionDAGInfo has been renamed to SelectionDAGTargetInfo and now lives in CodeGen rather than Target. r258939.

  • A LoopSimplifyCFG pass was added to canonicalise loops before running through passes such as LoopRotate and LoopUnroll. r259256.

Clang commits

  • The clang-cl driver will now warn for unknown arguments rather than erroring, to match the behaviour of MSVC. r258720.

  • The old autoconf build system was removed from Clang. r258862.

  • The 'sancov' (SanitizerCoverage) tool gained some documentation. r259000.

Other project commits

  • libcxx gained an implementation of ostream_joiner. r259014, r259015.

  • lld gained a new error function which won't cause process exit. The hope is this can be used to provide a gradual path towards lld-as-a-library. r259069.

  • The lit runner for the LLVM test suite can now be passed --param=profile=perf which will cause each test to be run under perf record. r259051.

by Alex Bradbury (noreply@blogger.com) at February 01, 2016 02:24 PM

January 25, 2016

LLVM Blog

LLVM Weekly - #108, Jan 25th 2016

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

News and articles from around the web

LLVM 3.8 RC1 has been released. Now is the time to test it out with your favourite projects and report any issues.

The deadline for the EuroLLVM call for papers is today.

Version 1.6 of the Rust programming language was released las week. Rust uses LLVM for its code generation.

The LLVM Social in Paris will be held this week on Wednesday.

On the mailing lists

LLVM commits

  • llvm::SplitModule gained a new flag which can be used to cause it to attempt to split the module without globalizing local objects. r258083.

  • The WebAssembly backend will now rematerialize constants with multiple uses rather than holding them live in registers, as there is no code size saving in using registers in for constants in most cases in the WebAssembly encoding. r258142.

  • Some small patches from the global instruction selection effort have started to land, such as the introduction of a generic machine opcode for ADD (G_ADD) and the all-important CMake support for building it. r258333, r258344.

  • getCacheLineSize was added to TargetTransformInfo. It's currently only used by PPCLoopDataPrefetch. r258419.

  • LoopIdiomRecognize improved in its ability to recognise memsets. r258620.

Clang commits

  • A number of new AST matchers were added. r258042, r258072, and more.

  • The LeakSanitizer documentation has been updated with a usage example. r258476.

Other project commits

  • The new ELF linker gained initial support for MIPS local GOT (global offset table) entries. r2583888.

  • The LLVM test suite now contains a ClangAnalyzer subdirectory containing tests for the static analyzer. r258336.

by Alex Bradbury (noreply@blogger.com) at January 25, 2016 12:48 PM

January 18, 2016

LLVM Blog

LLVM Weekly - #107, Jan 18th 2016

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

I have a very exciting piece of non-LLVM news to share this week. On Saturday I proposed to my partner Carrie Anne, and I'm delighted to report that she said yes. You may well question if this piece of personal news has any relevance to you, and in response I'd like to highlight just how important Carrie Anne is to this weekly newsletter. For over two years now, I've given up 2-3+ hours of my time every week without fail on evenings and weekends, time we could really be spending together as a couple. Without Carrie Anne's understanding and support LLVM Weekly couldn't exist. 2016 is going to be a very exciting year.

News and articles from around the web

Registration is now open for EuroLLVM 2016. The conference will be held in Barcelona on March 17th-18th. The call for papers closes on January 25th.

Registration is open for the Clang/LLVM development sprint to be held on the weekend of Feb 6th/7th at Bloomberg's London and New York offices.

The next Cambridge LLVM social will be held on Wednesday 20th January at 7.30pm, and will be colocated with the FreeBSD social.

On the mailing lists

LLVM commits

  • The ORC JIT API now supports remote JITing over an RPC interface to a separate process. The LLI tool has been updated to use this interface. r257305, r257343.

  • The Hexagon backend gained a target-independent SSA-based data flow framework for representing data flow between physical registers and passes using this to implement register liveness analysis, dead code elimination, and copy propagation. r257447, r257480, r257485, r257490.

  • The documentation on committing code reviewed on Phabricator to trunk has been improved. r257764.

  • WebAssembly gained a prototype instruction encoder and disassembler based on a temporary binary format. r257440.

  • LLVM's MathExtras gained a SaturatingMultiplyAdd helper. r257352.

  • llvm-readobj has much-expanded support for dumping CodeView debug info. r257658.

  • The code that finds code sequences implementing bswap or bitreverse and emits the appropriate intrinsic has been rewritten. r257875.

  • The AMDGPU backend gained a new machine scheduler for the Southern Islands architecture. r257609.

Clang commits

  • A Python implementation of scan-build has been added. r257533.

  • The 'interrupt' attribute is now supported on x86. r257867.

  • Clang learned to respond to the -fsanitize-stats flag. It can currently only be used with control-flow integrity and allows statistics to be dumped. r257971.

Other project commits

  • The compiler-rt CMake buildsystem gained experimental support for tvOS and watchOS. r257544.

  • Initial support was added for PPC and the new ELF linker. r257374.

  • The CMake and Lit runners in the LLVM test-suite can now support the integer C and C++ tests from SPEC CPU2006. r257370.

by Alex Bradbury (noreply@blogger.com) at January 18, 2016 01:33 PM

January 11, 2016

LLVM Blog

LLVM Weekly - #106, Jan 11th 2016

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

Many readers may be interested that last week was the 3rd RISC-V Workshop. You can find slides from the two lowRISC talks here and here. You may also want to read my liveblog of the event.

News and articles from around the web

The BSD Now podcast recently interviewed Alex Rosenberg about his work on LLVM/Clang and FreeBSD.

The folks at QuarksLab have shared a Clang hardening cheat sheet.

LLDB 3.8 will feature initial Go debugging support.

The next Paris LLVM Social will be held on January 27th and includes a talk from John Regehr.

The next Zurich LLVM Social will be taking place on January 14th.

On the mailing lists

LLVM commits

  • LLVM gained the -print-funcs option which can be used to filter IR printing to only certain functions. r256952.

  • The LLVM ADT library gained a new sum type abstraction for pointer-like types and an abstraction for embedding an integer within a pointer-like type. r257282, r257284.

  • LLVM now recognises the Samsung Exynos M1 core. r256828.

  • InstCombine learned to expose more constants when comparing getelementptrs (GEPs) by detecting when both GEPs could be expressed as GEPs with the same base pointer. r257064.

  • SelectionDAGBuilder will set NoUnsignedWrap for an inbounds getelementptr and for load/store offsets. r256890.

  • AArch64 MachineCombine will now allow fadd and fmul instructions to be reassociated. r257024.

  • Macro emission in DWARFv4 is now supported. r257060.

  • llvm-symbolizer gained the -print-source-context-lines option to print source code around the line. r257326.

Clang commits

  • Clang's CMake build system can now perform a multi-stage bootstrap build with profile-guided optimisation. r256873.

  • Clang's command line frontend learned to handle a whole bunch of -fno-builtin-* arguments. r256937.

  • The new ELF LLD linker will now be used for th AMDGPU target. r257175.

Other project commits

  • The performance of string table construction in the LLD ELF linker has been improved. This improves link time of lld by 12% from 3.50 seconds to 3.08 seconds. r257017.

  • The LLD ELF linker gained support for the AMDGPU target. r257023.

by Alex Bradbury (noreply@blogger.com) at January 11, 2016 01:15 PM

January 04, 2016

LLVM Blog

LLVM Weekly - #105, Jan 4th 2016

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

Happy new year! This issue marks the second anniversary of LLVM Weekly. It's rather short as the past week has been very quiet, with most LLVM developers seemingly taking a break over the holidays. My colleague Wei Song and myself will be presenting about lowRISC at the 3rd RISC-V workshop on Wednesday this week. Do say hi if you're going to be there.

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

News and articles from around the web

Sanjoy Das has written a blog post about issues with LLVM's undef value. Interestingly, he provides an example where undef can actually inhibit optimisations.

On the mailing lists

LLVM commits

  • The -align-all-loops and -align-all-functions arguments have been introduced to force function or loop alignments for testing purposes. r256571.

  • The x86 backend has added intrinsics for reading and writing to the flags register. r256685.

Clang commits

  • Various Clang classes have been converted to use the TrailingObjects helper. r256658, r256659, and more.

  • __readeflags and __writeeflags intrinsics are exposed in Clang. r256686.

Other project commits

  • In libcxx, undefined behaviour in <list> has been fixed for builtin pointer types and support added for the next ABI version. r256652.

by Alex Bradbury (noreply@blogger.com) at January 04, 2016 02:07 PM

Philip Reames

A perspective on friendly C

I was talking about John Regehr’s Friendly C proposal and recent follow-on post tonight with a friend, and decide to jot down some thoughts in a sharable format.

I believe the idea of a friendly C variant is entirely feasible, but it posses an incredibly challenging design problem.  Every change considered needs to be validated against a deep knowledge of the implementation of the associated compiler, runtime environment, and the underlying hardware.

As a simple example, let’s consider trying to establish semantics for stray (i.e. out of bounds) read and writes.  We can start by trying to define what happens for a stray read.  That’s fairly easy, we can simply return an undefined value.  We could even be a bit more restrictive and say that the value must be one which is written to that address by some part of the program.

(The vagueness in that last bit is to allow concurrent execution reordering.  However, we accidentally required atomic reads and writes since we disallowed wording tearing.  Is that a good thing or not?  There’s a cost to that, but maybe it’s a cost we’re willing to pay.  Or maybe not…)

Now let’s consider how to handle stray writes.  We could simply define them to be erroneous, but that simply gets us back to undefined behavior in C/C++.  We’re trying to avoid that.  We either need to detect them, or provide a reasonable semantics.  Detecting arbitrary stray writes is a very hard problem.  We can easily handle specific categories of stray writes through techniques like implicit null checking, but detecting an arbitrary stray write requires something like a full address-sanitizer (or possibly even more expensive checks).  I doubt anyone is willing to pay 2x performance for their C code to be more friendly.  If they were, why are they writing in C?

The challenge with having defined stray writes is what does a particular read return?  Does it return the last written value to a particular address?  Or the last value written to the particular field of the given object?  With out of bounds writes, these are not necessarily the same.

It’s very tempting to have the read return the last value written to the underlying address, but that introduces a huge problem.  In particular, it breaks essentially all load-load forwarding.

int foo(int* p_int, float p_float) {
 int a = *p_int;
 *p_float = 0.0;
 return a - *p_int;
}

In the example above, your normal C compiler could return “0” because it assumes the intervening write can’t change the value at p_int.  An implementation of a friendly C variant with the semantics we’ve proposed could not.  In practice, this is probably unacceptable from a performance perspective; memory optimization (load-load forwarding and associated optimizations) is a huge part of what a normal C/C++ compiler does.  (see: BasicAA, MDA. GVN, DSE, EarlyCSE in LLVM)

If we want to avoid that problem, we could try to be more subtle in our definition.  Let’s say we instead defined a read as returning either the last value written to that field (i.e. in bounds write) or underlying memory address (i.e. stray write).  We still have the problem of requiring atomic memory access, but we seem to have allowed the compiler optimization we intended.

The problem with this definition is that we’ve introduced a huge amount of complexity to our language specification and compiler.  We now have to have separate definitions of both our objects, their underlying addresses, and all the associated implementation machinery.

Another approach would be to define a read as returning either the last value written to the field (if no stray write has occurred to that address) or an undefined value (if a stray write to that address has occurred).  Is that friendly enough?

Moreover, what happens if we improve our ability to detect stray writes?  Are we allowed to make that write suddenly fail?  Is a program which functions only because of a stray write correct?

(Before you dismiss this as ridiculous, I personally know of an emergency software release that did nothing but reintroduce a particular stray memory write in a C++ program because it happened to restore behavior that a client had been relying on for many many years.)

Hopefully, I’ve given you a hint of the complexities inherent in any friendly C proposal.  These are the same complexities involved in designing any new language.  If anything designing a workable friendly-C proposal is harder than designing a new language.  At least with a new language you’d have the freedom to change other aspects of the language to avoid having to deal with garbage pointers entirely; in practice, that’s often the much easier approach.

 

by reames at January 04, 2016 04:32 AM

December 28, 2015

LLVM Blog

LLVM Weekly - #104, Dec 28th 2015

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

News and articles from around the web

The schedule for the LLVM devroom at FOSDEM has been published. This will be on January 30th 2016 in Brussels at FOSDEM.

Andy Finnell spent some time over the Christmas vacation porting the LLVM Kaleidoscope tutorial to Erlang and has kindly shared the fruits of his labours.

Richard Pennington has written another blog post about ELLCC, this time about using it to cross-compile the Linux kernel for the Raspberry Pi.

Tim Jones (lecturer at the University of Cambridge Computer Laboratory) has written about the alias analysis used in the HELIX compiler. There's nothing LLVM-specific here, indeed it was implemented using ILDJIT but should be of general interest to compiler developers.

On the mailing lists

LLVM commits

  • An initial implementation of an LLVMCodeView library has landed. This implements support for emitting debug info in the CodeView format. r256385.

  • lit has gained support for a per-test timeout which can be set using --timeout=. r256471.

  • All uses of edge wights in BranchProbabilityInfo have been replaced with probabilities. r256263.

  • The LLVM project documentation on patch reviews via Phabricator now has advice on choosing reviewers. r256265.

  • The gc.statepoint intrinsic's return type is now a token type rather than i32. r256443.

Clang commits

  • ASTtemplateKWAndArgsInfo and ASTTemplateArgumentListInfo have been converted to use the TrailingObjects header. This abstracts away reinterpret_cast, pointer arithmetic, and size calculations needed for the case where a class has some other objects appended to the end of it. r256359.

Other project commits

  • Development of LLD's new ELF linker is continuing, with support for new relocations on x86, x86-64, and MIPS. r256143, r256144, r256172, r256416.

by Alex Bradbury (noreply@blogger.com) at December 28, 2015 03:50 PM

December 21, 2015

LLVM Blog

LLVM Weekly - #103, Dec 21st 2015

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

Regular readers will know about lowRISC, a not-for-profit project a group of us founded aiming to produce a complete open-source System-on-Chip in volume. We've just hit a new milestone with the untethering of the base SoC. If you're interested in contributing, the blog post contains a number of potential starting points.

News and articles from around the web

The 6th EuroLLVM conference will be held on March 17th-18th in Barcelona, Spain. The call for papers is now open and will remain open until January 25th 2016. EuroLLVM CFP

Chandler Carruth's keynote, "Understanding compiler optimizations" from the Meeting C++ 2015 conference is now online.

Richard Pennington has blogged about bootstrapping LLVM and Clang using pre-compiled ELLCC binaries.

Bloomberg is going to be holding a weekend Clang and LLVM hackathon in NYC and in London on February 6th and 7th. The event will be open to everyone in the community and Bloomberg will provide space, power, food, beverages, and internet access.They're looking for experienced Clang and LLVM developers to help as mentors.

On the mailing lists

LLVM commits

  • LLVM IR now supports floating point atomic loads and stores. r255737.

  • New attributes have been introduced: InaccessibleMemOnly (a function may only access memory that is not accessible by the module being compiled) and InaccessibleMemOrArgMemOnly (a function may only access memory that is either not accessible by the module being compiled or is pointed to by its pointer arguments). r255778.

  • The PowerPC backend gained support for soft float operations on ppc32. r255516.

  • The terminatepad instruction has been removed from LLVM IR. r255522.

  • IR call instructions can now take a fast-math flags marker which indicates fast-math flags may allow otherwise unsafe optimisations. r255555.

  • LLVM gained a C++11 ThreadPool in its internal library. It is intended to be used for ThinLTO. r255593.

  • The default set of passes has been adjusted. mem2reg will not be run immediately after globalopt and more scalar optimization passes have been added to the LTO pipeline. r255634.

  • The llvm-profdata tool now supports specifying a weight when merging profile data. This can be used to give more relative importance to one of multiple profile runs. r255659.

  • For CMake builds, a compile_commands.json file will now be generated which tells tools like YouCompleteMe and clang_complete how to build each source file. r255789.

  • The Hexagon VLIW packetizer saw a large update (though unfortunately the changes aren't summarised in the commit message). r255807.

  • A number of LLVM's C APIs have been depreciated: LLVMParseBitcode, LLVMParseBitcodeInContext, LLVMGetBitcodeModuleInContext and LLVMGetBitcodeModule. These have been replaced with new versions of the functions which don't record a diagnostic. r256065.

  • The AVR backend (which is being imported incrementally) gained AVR.td and AVRRegisterInfo.td. r256120.

Clang commits

  • A new checker has been introduced to detect excess padding in classes and structs. r255545.

  • A new control-flow integrity mode was introduced, cross-DSO CFI allows control flow to be protected across shared objects. It is currently marked experimental. r255694.

  • Clang's CMake build system now supports generating profile data for Clang. r255740, r256069.

Other project commits

  • It is now possible to suppress reports from UndefinedBehaviourSanitizer for certain files, functions, or modules at runtime. r256018.

  • The llvm test-suite's CMake+Lit runner gained support for SPEC2000 and SPEC CPU95. r255876, r255878.

by Alex Bradbury (noreply@blogger.com) at December 21, 2015 10:13 PM

December 15, 2015

LLVM Blog

LLVM Weekly - #102, Dec 14th 2015

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

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

News and articles from around the web

Version 1.5 of the Rust programming language has been released. Rust of course uses LLVM as its backend.

George Balatsouras has written a blog post on compiling a project using autotools to LLVM bitcode.

On the mailing lists

LLVM commits

  • A new minimum spanning tree based method of instrumenting code for profile-guided optimisation was added. This guarantees the minimum number of CFG edges are instrumented. r255132.

  • MatchBSwap in InstCombine will now also detect bit reversals. r255334.

  • Sample-based profile-guided optimisation memory usage has been reduced by 10x by changing from using a DenseMap for sample records to a std::map. r255389.

  • An Instruction::getFunction method was added. It's perhaps surprising this didn't exist before. r254975.

  • FP16 vector instructions defined in ARMv8.2-A are now supported. r255010.

  • The EarlyCSE (common subexpression elimination) pass learned to perform value forwarding for unordered atomics. r255054.

  • Debug info in LLVM IR can now refer to macros. r255245.

  • LLVM's developer policy has been updated to detail the currently accepted C API stability policy and other guidelines. r255300.

  • A massive rework of funclet-oriented exception handling (needed for Windows exceptions) has landed. r255422.

Clang commits

  • Clang gained an option to use the new ThinLTO pipeline. r254927.

  • Hexagon will use the integrated assembler by default. r255127.

  • dllexport and dllimport attributes are now exposed through the libclang API. r255273.

Other project commits

  • ThreadSanitizer gained initial support for PPC64. r255057.

by Alex Bradbury (noreply@blogger.com) at December 15, 2015 09:41 AM

December 07, 2015

LLVM Blog

LLVM Weekly - #101, Dec 7th 2015

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

News and articles from around the web

The implementation of the Swift programming language is now open source. Rather than being a simple code dump, development will now occur out in the open with external contributions encouraged. If you haven't already, now might be a good time to watch Joseph Groff and Chris Lattner's talk on the Swift Intermediate Language.

Rui Ueyama wrote about the new LLD ELF linker on the official LLVM blog.

The Visual C++ team have released Clang with Microsoft CodeGen. This uses the Clang parser along with the code generator and optimizer from Visual C++. The majority of the Clang and LLVM changes will be contributed back upstream.

Alex Denisov wrote about using the LLVM API with Swift.

If you haven't already submitted your talk proposal for the LLVM devroom at FOSDEM, you've now got a little more time. Get your submission in by this Friday.

On the mailing lists

LLVM commits

  • llc and opt gained an option to run all passes twice. This is intended to help show up bugs that occur when using the same pass manager to compile multiple modules. r254774.

  • An initial prototype for llvm-dwp has been committed. This will eventually be a tool for building a DWARF package file out of a number of .dwo split debug files. r254355.

  • All weight-based interfaces in MachineBasicBlock have now been replaced with probability-based interfaces. r254377.

  • LLVM's STLExtras gained a range-based version of std::any_of and std::find. r254391, r254390.

  • llvm.get.dynamic.area.offset.{i32,264} intrinsics have been added. These can be used to get the address of the most recent dynamic alloca. r254404.

  • The X86 backend gained a new pass to reduce code size by removing redundant address recalculations for LEA. r254712.

  • The WebAssembly backend now has initial support for varargs. r254799.

Clang commits

  • Design docs have been added for forward-edge CFI for indirect calls. r254464.

  • The pass_object_size attribute was added to Clang. This intended to be used to work around cases where __builtin_object_size doesn't function. r254554.

  • Documentation was added for UndefinedBehaviorSanitizer. r254733.

Other project commits

  • LLD now supports the R_MIPS_HI16/LO16 relocations. r254461.

  • libomp can now make use of libhwloc on Unix to discover topology of the host system. r254320.

by Alex Bradbury (noreply@blogger.com) at December 07, 2015 11:52 AM

November 30, 2015

LLVM Blog

New ELF Linker from the LLVM Project

We have been working hard for a few months now to rewrite the ELF support in lld, the LLVM linker. We are happy to announce that it has reached a significant milestone: it is now able to bootstrap LLVM, Clang, and itself and pass all tests on x86-64 Linux and FreeBSD with the speed expected of an LLVM project.

ELF is the standard file format for executables on Unix-like systems, such as Linux and BSDs. GNU ld and GNU gold are commonly used linkers for such systems today. In many use cases, the linker is a black box for which only speed matters. Depending on program size, linking a program takes from tens of milliseconds to more than a minute. We designed the new linker so that it runs as fast as possible. Although no serious benchmarking or optimization has been conducted yet, it is consistently observed that the new lld links the LLVM/Clang/lld executables in about half the time of GNU gold. Generated executables are roughly the same size. lld is not at feature parity with gold yet, so it is too early to make a conclusion, but we are working hard to maintain or improve lld’s speed while adding more features.

lld is command-line compatible with GNU ld so that it can be used as a drop-in replacement. This does not necessarily mean that we are implementing all the features of the GNU linkers in the same way as they did. Some features are no longer relevant for modern Unix-like systems and can be removed. Some other features can be implemented in more efficient ways than those in the traditional linkers. Writing a new linker from scratch is a rare occasion. We take advantage of this opportunity to simplify the linker while keeping compatibility with the existing linkers for normal use.

The new ELF linker is a relatively small program which currently consists of about 7000 lines of C++ code. It is based on the same design as the PE/COFF (Windows) support in lld, so the design document for the PE/COFF support is directly applicable to the ELF support.

The older ELF support still exists in lld repository in parallel with the new one. Please be careful to not confuse the two. They are separated at the top directory and do not share code. You can run the new linker with ld.lld command or by passing -fuse-ld=lld to Clang when linking.

We are still working on implementing remaining functionality such as improved linker script support or improved support for architectures beyond x86_64. If you are interested in the new linker, try it out for yourself.

by Rui Ueyama (noreply@blogger.com) at November 30, 2015 04:29 PM

LLVM Weekly - #100, Nov 30th 2015

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

Eagle-eyed readers will note we've now reached issue 100, marking 100 weeks of uninterrupted service and of course meaning there's just 28 weeks to go until an important numerical milestone.

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

News and articles from around the web

There is going to be an LLVM Devroom at FOSDEM next year and the call for proposals closes on December 1st. Get your submissions in!

Most slides from the recent LLVM in HPC workshop have now been posted.

Jeff Trull has posted a great blog post on fuzzing C++ code with AFL and libFuzzer.

On the mailing lists

LLVM commits

  • A number of patches related to ARMv8.2-A have landed. Public documentation doesn't seem to have been released for this architecture revision, but the patches indicate some of the new features including: persistent memory instruction and FP16 instructions. You can see the patches still in review here. r254156, r254198.

  • A series of helper functions from SelectionDAGNodes have been exposed (isNullConstant, isNullFPConstant, isAllOnesConstant, isOneConstant). These helpers can help simplify code in your target's ISelLowering. r254085.

  • The WebAssembly backend's block placement algorithm has been improved. r253876.

  • Tests generated from utils/update_llc_test_checks.py are now marked as autogenerated. r253917.

Clang commits

  • DataRecursiveASTVisitor has been removed, and RecursiveASTVisitor can be used in its place. This resulted in the removal of 2912 lines of code. r253948.

  • Sparc and SparcV9 default to using an external assembler again. r254199

  • Functions with the interrupt attribute are now supported for mips32r2+. r254205.

Other project commits

  • A single DataFlowSanitizer or ThreadSanitizer-instrumented binary can now run on both 39-bit virtual address space and 42-bit virtual address space AArch64 platforms. r254151, r254197.

  • lldb gained a swig_bot.py for generating bindings. r254022.

by Alex Bradbury (noreply@blogger.com) at November 30, 2015 12:41 PM

November 23, 2015

LLVM Blog

LLVM Weekly - #99, Nov 23rd 2015

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

News and articles from around the web

LLVM/Clang 3.7.1-rc2 has been tagged. As always, help testing is appreciated.

Clasp 0.4 has been released. Clasp is a new Common Lisp implementation that uses LLVM as a compiler backend and aims to offer seamless C++ interoperation.

On the mailing lists

LLVM commits

  • Initial support for value profiling landed. r253484.

  • It is now possible to use the -force-attribute command-line option for specifying a function attribute for a particular function (e.g. norecurse, noinline etc). This should be very useful for testing. r253550.

  • The WebAssembly backend gained initial prototype passes for register coloring (on its virtual registers) and register stackifying. r253217, r253465.

  • The built-in assembler now treats fatal errors as non-fatal in order to report all errors in a file rather than just the first one encountered. r253328.

  • As discussed on the mailing list last week, lane masks are now always precise. r253279.

  • Support for prelinking has been dropped. See the commit message for a full rationale. r253280.

  • llvm-lto can now be used to emit assembly rather than object code. r253622, r253624.

Clang commits

  • Clang should now be usable for CUDA compilation out of the box. r253389.

  • When giving the -mcpu/-march options to Clang targeting ARM, you can now specify +feature. r253471.

Other project commits

  • Compiler-rt gained support for value profiling. r253483.

  • The 'new ELF linker' is now the default ELF linker in lld. r253318.

  • The LLVM test suite gained support for running SPEC2000int and SPEC2006int+fp with PGO and reference inputs. r253362.

by Alex Bradbury (noreply@blogger.com) at November 23, 2015 02:20 PM

November 16, 2015

LLVM Blog

LLVM Weekly - #98, Nov 16th 2015

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

This week's issue comes to you from Vienna where I'm just about to head home from a short break (so apologies if it's a little later than usual and perhaps a little less detailed). I'll admit that nobody has actually written in to beg that LLVM Weekly share travel tips, but I will say that Vienna is a beautiful city that's provided lots to do over the past few days. If you're visiting, I can strongly recommend Salm Bräu for good beer and food.

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

News and articles from around the web

All of the LLVM Dev Meeting Videos are now up, and will stay up. This includes Chris Lattner and Joseph Groff's talk on Swift's IR. You can also find most of the slides here. The folks at Quarkslab have also posted a trip report.

The big news this week is that code derived from NVIDIA's PGI Fortran compiler is to be open-sourced and a production-grade Fortran front-end to LLVM produced. This project is a collaboration between the US NNSA (National Nuclear Security Administration), NVIDIA, and the Lawrence Livermore, Sandia, and Los Alamos national laboratories. Hal Finkel has shared a little more on the LLVM mailing list. With a source code release not due for about another year, where does this leave the existing Flang efforts? The hope is that parts of Flang will be merged with the PGI release. Douglas Miles from the PGI team has also shared a mini-FAQ. Fortran announcement

Bjarne Stroustrup has shared a detailed trip report from the last C++ Standards Meeting.

This post over at the Include Security Blog delves in to some details of support for the SafeStack buffer overflow protection in LLVM.

At the official LLVM blog, a new post gives a very useful guide on how to reduce your testcases using bugpoint and custom scripts. As the post notes, bugpoint is a very powerful tool but can be difficult to use.

On the mailing lists

LLVM commits

  • LLVM's autoconf-based build system is now officially deprecated, with the CMake build system being preferred. r252520.

  • Do you want to compile CUDA code with Clang and LLVM? There's now some handy documentation describing how to do so. See also Jingyue's talk from the recent LLVM Dev Meeting. r252660.

  • A simple MachineInstruction SSA pass for PowerPC has been added. The implementation is short and straight-forward, so worth a read if you want to do some MI-level peephole optimisations for your target. r252651.

  • Basic support for AArch64's address tagging has been added. In AArch64, the top 8 bits of an address can be used to store extra metadata with these bits being masked out before going through address translation. r252573.

  • The Hexagon backend now supports assembly parsing. r252443.

  • The CMake build system gained a new LLVMExternalProjectUtils module. As an example, this is used with the LLVM test suite which can be set up to be rebuilt whenever the in-tree clang or lld change. This could also be used with compiler-rt or libcxx. r252747.

  • An 'empty token' is now defined (written as token empty) for when using tokens in LLVM IR. r252811.

  • LibFuzzer gained a new experimental search heuristic, drill. As the comment in FuzzerLoop.cpp explains, this will 1) read+shuffle+execute+minimize the corpus, 2) choose a random unit, 3) reset the coverage, 4) start fuzzing as if the chosen unit was the only element of the corpus, 5) reset the coverage again when done, 6) merge the newly created corpus into the original one. r252838.

  • A BITREVERSE SelectionDAG node and a set of llvm.bitreverse.* intrinsics have been introduced. The intention is that backends should no longer have to reimplement similar code to match instruction patterns to their own ISA's bitreverse instruction. See also the patch to the ARM backend that replaces ARMISD::RBIT with ISD::BITREVERSE. r252878, r253047.

Clang commits

  • Support for __attribute__(internal_linkage) was added. This is much like C's static keyword, but applies to C++ class methods. r252648.

  • Clang now supports GCC's __auto_type extension, with a few minor enhancements. r252690.

Other project commits

  • libcxx gained initial support for building with mustl libc. Primarily this is a new CMake option, necessary as Musl doesn't provide a macro to indicate its presense. r252457).

by Alex Bradbury (noreply@blogger.com) at November 16, 2015 12:18 PM

November 13, 2015

LLVM Blog

Reduce Your Testcases with Bugpoint and Custom Scripts

LLVM provides many useful command line tools to handle bitcode: opt is the most widely known and is used to run individual passes on an IR module, and llc invokes the backend to generate an assembly or object file from an IR module. Less known but very powerful is bugpoint, the automatic test case reduction tool, that should be part of every developer's toolbox.

The bugpoint tool helps to reduce an input IR file while preserving some interesting behavior, usually a compiler crash or a miscompile. Multiple strategies are involved in the reduction of the test case (shuffling instructions, modifying the control flow, etc.), but because it is oblivious to the LLVM passes and the individual backend specificities, "it may appear to do stupid things or miss obvious simplifications", as stated in the official description. The documentation gives some insights on the strategies that can be involved by bugpoint, but the details are beyond the scope of this post.

Read on to learn how you can use the power of bugpoint to solve some non-obvious problems.

Bugpoint Interface Considered Harmful

Bugpoint is a powerful tool to reduce your test case, but its interface can lead to frustration (as stated in the documentation: "bugpoint can be a remarkably useful tool, but it sometimes works in non-obvious ways"). One of the main issue seems to be that bugpoint is ironically too advanced! It operates under three modes and switches automatically among them to solve different kind of problem: crash, miscompilation, or code generation (see the documentation for more information on these modes). However it is not always obvious to know beforehand which mode will be activated and which strategy bugpoint is actually using.

I found that for most of my uses, I don't want the advanced bugpoint features that deal with pass ordering for example, and I don't need bugpoint to detect which mode to operate and switch automatically. For most of my usage, the `compile-custom` option is perfectly adequate: similar to
`git bisect`, it allows you to provide a script to bugpoint. This script is a black box for bugpoint, it needs to accept a single argument (the bitcode file to process) and needs to return 0 if the bitcode does not exhibit the behavior you're interested in, or a non zero value in the other case. Bugpoint will apply multiple strategies in order to reduce the test case, and will call your custom script after each transformation to validate if the behavior you're looking for is still exhibited. The invocation for bugpoint is the following:

$ ./bin/bugpoint -compile-custom -compile-command=./check.sh -opt-command=./bin/opt my_test_case.ll

The important part is the two options -compile-custom and -compile-command=path_to_script.sh that indicate to bugpoint that it should use your own script to process the file. The other important part is the -opt-command option that should point to the correct opt that will be used to reduce the test case. Indeed by default bugpoint will search in the path for opt and may use an old system one that won't be able to process your IR properly, leading to some curious error message:

*** Debugging code generator crash!
Checking for crash with only these blocks:  diamond .preheader .lr.ph .end: error: Invalid type for value
simplifycfg failed!

Considering such a script `check.sh`, running it with your original test case this way:

$ ./check.sh my_test_case.ll && echo "NON-INTERESTING" || echo "INTERESTING"

should display INTERESTING before you try to use it with bugpoint, or you may very well be surprised. In fact bugpoint considers the script as a compile command. If you start with an NON-INTERESTING test case and feed it to bugpoint, it will assume that the code compiles correctly, and will try to assemble it, link it, and execute it to get a reference result. This is where bugpoint behavior can be confusing when it automatically switches mode, leaving the user with a confusing trace. A correct invocation should lead to a trace such as:

./bin/bugpoint  -compile-custom  -compile-command=./check.sh  -opt-command=./bin/opt slp.ll 
Read input file      : 'slp.ll'
*** All input ok
Initializing execution environment: Found command in: ./check.sh
Running the code generator to test for a crash: 
Error running tool:
  ./check.sh bugpoint-test-program-1aa0e1d.bc
*** Debugging code generator crash!

Checking to see if we can delete global inits: <crash>

*** Able to remove all global initializers!
Checking for crash with only these blocks:    .lr.ph6.preheader .preheader .lr.ph.preheader .lr.ph .backedge  ._crit_edge.loopexit... <11 total>: <crash>
Checking for crash with only these blocks: .preheader .backedge .lr.ph6.preheader: 
Checking for crash with only these blocks: .lr.ph ._crit_edge: 
...
...
Checking instruction:   store i8 %16, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @cle, i64 0, i64 15), align 1, !tbaa !2

*** Attempting to perform final cleanups: <crash>
Emitted bitcode to 'bugpoint-reduced-simplified.bc'

In practice the ability to write a custom script is very powerful, I will go over a few use cases I recently used bugpoint with.

Search For a String in the Output

I recently submitted a patch (http://reviews.llvm.org/D14364) for a case where the loop vectorizer didn't kick-in on a quite simple test case. After fixing the underlying issue I needed to submit a test with my patch. The original IR was a few hundred lines. Since I believe it is good practice to reduce test cases as much as possible, bugpoint is often my best friend. In this case the analysis result indicates "Memory dependences are safe with run-time checks" on the output after my patch.

Having compiled `opt` with and without my patch and copied each version in `/tmp/` I wrote this shell script:


#!/bin/bash

/tmp/opt.original -loop-accesses -analyze $1 | grep "Memory dependences are safe"
res_original=$?
/tmp/opt.patched -loop-accesses -analyze $1 | grep "Memory dependences are safe"
res_patched=$?
[[ $res_original == 1 && $res_patched == 0 ]] && exit 1
exit 0 

It first runs the bitcode supplied as argument to the script (the $1 above) through opt and uses grep to check for the presence of the expected string in the output. When grep exits, $? contains with 1 if the string is not present in the output. The reduced test case is valid if the original opt didn't produce the expected analysis but the new opt did.

Reduce While a Transformation Makes Effects

In another case (http://reviews.llvm.org/D13996), I patched the SLP vectorizer and I wanted to reduce the test case so that it didn't vectorize before my changes but vectorizes after:

#!/bin/bash
set -e

/tmp/opt.original -slp-vectorizer -S > /tmp/original.ll $1
/tmp/opt.patched -slp-vectorizer -S > /tmp/patched.ll $1
diff /tmp/original.ll /tmp/patched.ll && exit 0
exit 1

The use of a custom script offers flexibility and allows to run any complex logic to decide if a reduction is valid or not. I used it in the past to reduce crashes on a specific assertion and avoiding the reduction leading to a different crash, or to reduce for tracking instruction count regressions or any other metric.

Just Use FileCheck

LLVM comes with a Flexible pattern matching file verifier (FileCheck) that the tests are using intensively. You can annotate your original test case and write a script that reduce it for your patch. Let's take an example from the public LLVM repository with commit r252051 "[SimplifyCFG] Merge conditional stores". The associated test in the validation is test/Transforms/SimplifyCFG/merge-cond-stores.ll ; and it already contains all the check we need, let's try to reduce it. For this purpose you'll need to process one function at a time, or bugpoint may not produce what you expect: because the check will fail for one function, bugpoint can do any transformation to another function and the test would still be considered "interesting". Let's extract the function test_diamond_simple from the original file:

$ ./bin/llvm-extract -func=test_diamond_simple test/Transforms/SimplifyCFG/merge-cond-stores.ll -S > /tmp/my_test_case.ll

Then checkout and compile opt for revision r252050 and r252051, and copy them in /tmp/opt.r252050 and /tmp/opt.r252051. The check.sh script is then based on the CHECK line in the original test case:

#!/bin/bash

# Process the test before the patch and check with FileCheck,
# this is expected to fail.
/tmp/opt.r252050 -simplifycfg -instcombine -phi-node-folding-threshold=2 -S < $1 | ./bin/FileCheck merge-cons-stores.ll
original=$?

# Process the test after the patch and check with FileCheck,
# this is expected to succeed.
/tmp/opt.r252051 -simplifycfg -instcombine -phi-node-folding-threshold=2 -S < $1 | ./bin/FileCheck merge-cons-stores.ll
patched=$?

# The test is interesting if FileCheck failed before and
# succeed after the patch.
[[ $original != 0 && $patched == 0 ]] && exit 1
exit 0

I intentionally selected a very well written test to show you both the power of bugpoint and its limitation. If you look at the function we just extracted in my_test_case.ll for instance:

; CHECK-LABEL: @test_diamond_simple
; This should get if-converted.
; CHECK: store
; CHECK-NOT: store
; CHECK: ret
define i32 @test_diamond_simple(i32%pi32%qi32 %ai32 %b) {
entry:
  %x1 = icmp eq i32 %a0
  br i1 %x1label %no1label %yes1

yes1:
  store i32 0i32%p
  br label %fallthrough

no1:
  %z1 = add i32 %a%b
  br label %fallthrough

fallthrough:
  %z2 = phi i32 [ %z1%no1 ], [ 0%yes1 ]
  %x2 = icmp eq i32 %b0
  br i1 %x2label %no2label %yes2

yes2:
  store i32 1i32%p
  br label %end

no2:
  %z3 = sub i32 %z2%b
  br label %end

end:
  %z4 = phi i32 [ %z3%no2 ], [ 3%yes2 ]
  ret i32 %z4
}

The transformation introduced in this patch allows to merge the stores in the true branches yes1 and yes2:

declare void @f()

define i32 @test_diamond_simple(i32%pi32%qi32 %ai32 %b) {
entry:
  %x1 = icmp eq i32 %a0
  %z1 = add i32 %a%b
  %z2 = select i1 %x1i32 %z1i32 0
  %x2 = icmp eq i32 %b0
  %z3 = sub i32 %z2%b
  %z4 = select i1 %x2i32 %z3i32 3
  %0 = or i32 %a%b
  %1 = icmp eq i32 %00
  br i1 %1label %3label %2

; <label>:2 ; preds = %entry
  %simplifycfg.merge = select i1 %x2i32 %z2i32 1
  store i32 %simplifycfg.mergei32%palign 4
  br label %3

; <label>:3 ; preds = %entry, %2
  ret i32 %z4
}

The original code seems pretty minimal, the variable and block names are explicit, it is easy to follow and you probably wouldn't think about reducing it. For the exercise, let's have a look at what bugpoint can do for us here:

define void @test_diamond_simple(i32%pi32 %b) {
entry:
  br i1 undeflabel %fallthroughlabel %yes1

yes1:                  ; preds = %entry
  store i32 0i32%p
  br label %fallthrough

fallthrough:           ; preds = %yes1, %entry
  %x2 = icmp eq i32 %b0
  br i1 %x2label %endlabel %yes2

yes2:                  ; preds = %fallthrough
  store i32 1i32%p
  br label %end

yes2:                  ; preds = %yes2, %fallthrough
  ret void
}

Bugpoint figured out that the no branches were useless for this test and removed them. The drawback is that bugpoint also has a tendency to introduce undef or unreachable here and there, which can make the test more fragile and harder to understand.  

Not There Yet: Manual Cleanup

At the end of the reduction, the test is small but probably not ready to be submitted with your patch "as is". Some cleanup is probably still needed: for instance bugpoint won't convert invoke into calls,  remove metadata, tbaa informations, personality function, etc. We also saw before that bugpoint can modify your test in unexpected way, adding undef or unreachable. Also you probably want to rename the variables to end up with a readable test case.

Fortunately, having the check.sh script at hand is helpful in this process, since you can just manually modify your test and run continuously the same command:

$ ./check.sh my_test_case.ll && echo "NON-INTERESTING" || echo "INTERESTING"

While the result is  INTERESTING you know you keep having a valid test and you can continue to proceed with your cleanup.

Keep in mind that bugpoint can do far more, but hopefully this subset will be helpful to the ones that are still struggling with its command line options.

Finally, I'm grateful to Manman Ren for her review of this post.

by Joker-eph (noreply@blogger.com) at November 13, 2015 04:18 AM

November 09, 2015

LLVM Blog

LLVM Weekly - #97, Nov 9th 2015

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

News and articles from around the web

A number of slide decks have started appearing from last week's LLVM Dev Meeting. The first set of videos made a brief appearance here but apparently they weren't ready for distribution and have been taken down again. In the mean time, you might be interested in the slides for: Living downstream without drowning, Automated performance tracking of LLVM-generated code, opaque pointer types, and debug info on a diet.

Pyston 0.4 has been released. It now features a baseline JIT in addition to the LLVM JIT.

The LLVM-based ELLCC cross-compilation tool chain has had a new release, version 0.1.18. This release has been tested for building the Linux kernel.

There is going to be an LLVM devroom at FOSDEM 2016. Check here for the call for papers and participation. The deadline for receiving submissions is December 1st.

On the mailing lists

  • As loyal LLVM Weekly readers will know, for a long time now there's been a movement to replace autoconf in the LLVM build system with CMake. It's now at the point where Chris Bieneman suggests we should consider deprecating autoconf. His proposal suggests it is marked deprecated for the 3.8 release and removed after 3.8 branches from the main development tree. This proposal is getting a lot of positive feedback.

  • After a discussion about the spotty use of the DEBUG_TYPE in passes to prefix debug messages, Daniel Berlin makes the suggestion that a new DEBUG_MSG macro be introduced which will always include the DEBUG_TYPE. Although there are a number of responses indicating how useful they find it when debug messages are prefixed with their source, there doesn't seem to yet be a consensus on whether it's worth replacing all DEBUG(dbgs() << ..) with something like this.

  • George Burgess is seeking feedback for his proposal on performing nullability analysis in Clang.

  • Richard Diamond has written a proposal on introducing an llvm.blackbox intrinsic with the purpose of explicitly preventing certain optimisations. So far, there's some confusion about exactly what this intrinsic would do, and whether there's an alternative way to achieve the same aims.

  • James Molloy proposes adding a new norecurse attribute. With no major exceptions, this has actually already been committed. See the commit summary below for more information.

  • David Blaikie is planning to implement an llvm-dwp tool to support building a DWARF package file out of a number of .dwo split debug files. He is seeking feedback on his plan.

  • Chris Bieneman has been improving support with the CMake build system for bootstrapping a cross-compiler toolchain and has run in to issues involving compiler-rt and bootstrapping builtins. There seems to be some support for the third of the proposed options, splitting the builtins and runtime libraries.

LLVM commits

  • A new optimisation was added to SimplifyCFG to merge conditional stores. The commit message notes it has little impact on the standard LLVM test suite, but it apparently causes many changes in a third party suite. r252051.

  • Implicit conversions between ilist iterators and pointers are now disabled. All in-tree code has been updated to use explicit conversions, but out-of-tree developers may need to either revert this patch for now or update their code. r252380.

  • The LoopLoadElimination pass was introduced, which can discover store-to-load forwarding opportunities. r251972, r252017.

  • Work on operand bundles continues with the addition of a data_operand abstraction. r252077.

  • LLVM gained portable helper macros for packed struct definitions. r252099.

  • DebugInfo has been modified so that a reference to a subprogram is stored in function-level metadata rather than subprograms containing a metadata reference to the function they describe. A script to update out-of-tree textual IR is attached here. r252219, r252268.

  • The norecurse attribute has been introduced. This indicates the function will never recurse into itself, either directly or indirectly, and can be used to demote global variables to locals. r252282.

  • The notail marker for call instructions was added, which prevents tail or musttail markers being added by the optimizer. r252368.

Clang commits

  • The idea of 'module file extensions' has been introduced. These add additional information to a module file that can be queried when it's read, allowing tools built on Clang to stash their own data in module files. See the original mailing list RFC for more details. r251955.

  • Clang now supports the __make_integer_seq template. __make_integer_seq<std::integer_sequence, int, 90000> takes 0.25 seconds while std::make_integer_sequence<int, 90000> takes so long the patch author didn't wait for it to finish. r252036.

  • The newly-introduced VforkChecker will look for unsafe code in a vforked process. r252285.

Other project commits

by Alex Bradbury (noreply@blogger.com) at November 09, 2015 04:28 PM

November 02, 2015

LLVM Blog

LLVM Weekly - #96, Nov 2nd 2015

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

News and articles from around the web

Some slides have started to appear from last week's LLVM Dev Meeting already. It seems like a good time was had by all, I'm disappointed to have missed it. To pre-empt the obvious question, yes the talks were recorded and videos will be up in the next few weeks. In particular, see the slides from Chris Lattner and Joe Groff on the Swift Intermediate Language. Slides are also up for Hans Wennborg's lightning talk on switch lowering improvements as well as Reid Kleckner and David Majnemer's talk on extending exception handling in LLVM to support MSVC's model.

Timothy Jones has written a blog post about throttled SLP and how counter-intuitively you can boost performance by limiting vectorisation. This was developed with Vasileios Porpodas who presented the paper at PACT and talked about it at last week's LLVM dev meeting.

Microsoft have begun to publicly document the PDB format with the aim of helping the Clang and LLVM communities. The original creator of PDB also shared a series of thoughts and details on Twitter.

Portable Computing Language (pocl) v0.12 has been released. pocl aims to be an open-source, performance portable implementation of the OpenCL standard. This release includes support for HSA-compliant devices and is the last one that will build with older LLVM versions.

On the mailing lists

LLVM commits

  • An improvement to codegen for ARM/ELF for global variable addresses means that Chromium for Android builds are now 4% smaller. r251322.

  • Support for the Apple WatchOS ABI and its compact unwind information has landed. r251570, r251573.

  • LLVM's bitcode format can now include an identification block. This contains a string that can be used to give information on the bitcode producer as well as an 'epoch' number, intended to increase monotonically as incompatible changes to the bitcode are made. This should allow for more user-friendly error messages upon attempting to read incompatible bitcode. r251325.

  • Experimental C bindings for the Orc JIT compilation API have been added. r251472.

  • The 'interrupt' attribute on functions is now supported for mips32r2+. r251286.

  • AARch64LoadStoreOptimizer learned to merge two halfword loads into a single 32-bit load. r251438.

Clang commits

  • Implementation of support for C++1z coroutines continues. r251387.

  • The -Wdouble-promotion warning was implemented, which warns when an implicit conversion increases the width of a single precision float to a double. r251588.

  • Support for new __builtin_{add,sub,mul}_overflow builtins was added. These work generically for operands of any integer type. r251651.

  • Command-line options for targetting watchOS and tvOS were added to Clang as well as ABI changes. r251706, r251710.

  • The libClang bindings now expose the is_mutable_field. r251410.

Other project commits

  • The llvm test-suite gained a new CMake+Lit build system/harness. r251431.

by Alex Bradbury (noreply@blogger.com) at November 02, 2015 04:54 PM

October 26, 2015

LLVM Blog

LLVM Weekly - #95, Oct 26th 2015

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

News and articles from around the web

The C++ Standardization Committee just finished up their most recent meeting, and STL (Stephan T. Lavavej) has provided a useful summary. Herb Sutter has also posted a trip report.

The HHVM team have posted an update on the status of LLVM code generation in HHVM. They managed to get LLVM to equal the performance of their custom backend, but are not going to deploy the LLVM backend to production for now. They're no longer actively working on the LLVM backend, but hope to ensure it doesn't regress.

Hal Finkel is proposing an LLVM social in Austin on the evening of November 15th. There should be a high density of LLVM users due to the LLVM in HPC workshop.

On the mailing lists

LLVM commits

  • The TargetLowerBase::LibCall LegalizeAction has been introduced. This allows backends to control whether they prefer expansion or conversion to a libcall. r250826.

  • The Hexagon backend continues to accumulate sophisticated target-specific optimisations. HexagonBitSimplify continues a number of transformations to perform simplifications, redundant code elimination etc. r250868.

  • The new AliasAnalysis infrastructure gained an optional 'external' AA wrapper pass, to allow users to merge in external AA results. The unit test included in the patch gives a good example of how to use this. r250894.

  • CodeGenPrepare can now transform select instructions into branches and sink expensive operands. r250743.

  • Loop rotation can now use profile data in making decisions during MachineBlockPlacement. r250754.

  • ValueTracking now has a isKnownNonEqual predicate. r251012.

Clang commits

  • Basic (currently parsing and basic semantic analysis) support for the anticipated C++1z coroutine feature was added. r250980, r250985, r250993.

  • -fvisibility=internal is now aliased to -fvisibility=hidden, as LLVM doesn't currently support internal visibility. r250954.

  • Clang's static analyzer learnt to associate hashes with found issues. This hash aims to be resilient to code changes, so should be useful for suppressing false positives. r251011.

Other project commits

  • lld gained support for lazy relocations on x86-64. r250808.

  • The new LLD ELF linker now supports the --gc-sections parameter. This increases the time to link Clang by 8% bus reduces the size of the output binary by 4%. r251043.

  • LLDB gained a REPL. r250753, r250773.

  • DWARF parsing in LLDB can now be multi-threaded, which can drastically incrase the speed of loading debug info. r251106.

by Alex Bradbury (noreply@blogger.com) at October 26, 2015 03:34 PM

October 20, 2015

LLVM Blog

LLVM Weekly - #94, Oct 19th 2015

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

A good time was had by all at ORConf last week at CERN. We had over 100 open source hardware enthusiasts join us in Geneva. You can find my slides updating on lowRISC here. Videos should appear on youtube in the next week or so.

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

News and articles from around the web

A six month retrospective of LLILC, the project to produce an open source LLVM-based compiler for .NET, has been posted. It describes work still to be done for garbage collection and exception handling, code size and code quality, and JIT throughput.

The schedule for the 2015 LLVM Developers' Meeting is now available.

The new ELF linker in LLD is looking pretty fast. Right now it can link Clang in about half the time of binutils gold. However, the resulting binary is larger. It will be interesting to see how the performance compares when both are at feature parity, but this is looking promising.

On the mailing lists

LLVM commits

  • Hexagon gained a new pass to merge adjacent stores. r250542.

  • Hexagon gained skeleton support for the 'HVX' extension instructions. r250600.

  • The loop vectorizer will now shrink integer operations into the smallest type possible. r250032.

  • Documentation has been added for binary sample profile encoding. r250309.

  • RewriteStatpointsForGC is starting to make use of operand bundles. r250489.

Clang commits

  • Clang gained support for the -fdebug-prefix-map= option as in GCC. r250094.

  • The PS4 toolchain definition has been added to Clang. r250262.

  • Clang now understands -flto=thin. r250398.

Other project commits

  • The libc++ testing guide has been updated. r250323.

  • LLD got even faster at linking clang. r250315.

  • LLDB gained preliminary NetBSD support. r250146.

by Alex Bradbury (noreply@blogger.com) at October 20, 2015 04:05 PM

October 19, 2015

LLVM Blog

LLVM Weekly - #93, Oct 12th 2015

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

Apologies that this week's issue comes rather late in the day, my laptop gave up the ghost over the weekend while I was travelling leaving me with no way to write it. Now I'm back, I've managed to dust off an old desktop from my closet to write this issue (and to keep my unbroken streak). LLVM Weekly has been sent out every Monday since it started on the first Monday of January 2014. This weekend I was talking about lowRISC at ORConf 2015. You can find my slides here. There was a wide array of talks on open source hardware, including many on lowRISC and RISC-V. The videos should hopefully be posted in the next week or so.

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

News and articles from around the web

The LLVM project has hit 250,000 commits. The commit that managed to hit this milestone was this one-liner.

A new paper by Bjarne Stroustrup, Herb Sutter, and Gabriel Dos Reis gives more details on their plans for memory safety in C++.

Videos from CppCon2015 are being posted to Youtube.

On the mailing lists

LLVM commits

  • The Hexagon architecture gained an early if-conversion pass. r249423.

  • ThinLTO has started to land, in particular support for function summary index bitcode sections and files. r249270.

  • Codegen for ARM's memcpy intrinsic has been modified to make better use of LDM/STM. r249322.

  • The llvm.eh.exceptioncode intrinsic was added. r249492.

  • It is now possible to turn off MMX support without disabling SSE. r249731.

Clang commits

  • The policy for adding new style options to clang-format has been documented. r249289.

  • The libclang bindings have been extended with accessors for C++ function attributes (pure virtual, virtual, or const). r250008.

Other project commits

  • GoLanguageRuntime was introduced to LLDB, which supports finding the runtime type for Go interfaces. r249456, r249459.

  • The new LLD ELF linker now supports the --as-needed option. r249998.

  • LLDB for MIPS is now able to emulate microMIPS instructions. r249381.

  • liblldb is working towards being able to work under both Python 2.x and 3.x. r249886.

by Alex Bradbury (noreply@blogger.com) at October 19, 2015 10:52 AM

October 15, 2015

OpenMP Runtime Project

New code release

We are excited to announce the next release of the Intel® OpenMP* Runtime Library at openmprtl.org. This release aligns with Intel® Parallel Studio XE 2016 Composer Edition Update 1.

New Features

  • Added dynamic/hinted lock implementation that supports OpenMP* locks with hints
  • Disabled monitor thread when KMP_BLOCKTIME=infinite
  • Improved stack protection with safe C library for string/memory operations

Bug Fixes

by mad\hbae at October 15, 2015 08:36 PM

October 05, 2015

LLVM Blog

LLVM Weekly - #92, Oct 5th 2015

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

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

News and articles from around the web

Most of the presentation materials from CppCon2015 are now online. Talks that may be of particular interest include Kostya Serebryany on fuzzing with libFuzzer, Piotr Padlewski on C++ devirtualization in Clang, and JF Bastien talking about C++ on the web.

Rafael Espíndola wrote in to share an impressive milestone for the new LLD ELF linker. It can now link itself and all of LLVM and Clang (though not all tests pass, and you must use LLVM_ENABLE_THREADS=OFF). Things will of course get really interesting once LLD matures if it can compete with Gold in terms of speed.

The next Paris LLVM social will take place on October 15th. Calixte Denizet will be talking about Scilab's usage of LLVM.

On the mailing lists

LLVM commits

  • A scheduler for the MIPS P5600 processor landed. r248725.

  • Align metadata for the load instruction was introduced. r248721.

  • Support for windows exception handling continues with support in AsmPrinter for 'funclets'. r248824.

  • Support landed for the HHVM JIT calling convention. r248832.

Clang commits

  • clang-format's #include sorting functionality has been extended. r248782.

Other project commits

  • The new ELF linker gained initial support for MIPS. r248779.

  • Some basic linker script support was added to the new ELF linker, enough to parse Linux's libc.so. r248918.

  • .ARM.exidx and .ARM.extab unwind information is now supported by lldb. r248903.

by Alex Bradbury (noreply@blogger.com) at October 05, 2015 12:32 PM

September 28, 2015

LLVM Blog

LLVM Weekly - #91, Sep 28th 2015

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

News and articles from around the web

Some slides and videos from cppcon have started to appear. See the slides from Bjarne Stroustrup's keynote (which focus on the Core Guidelines project), as well as Herb Sutter's slides on supporting ownership annotations in C++ (this will be familiar to anyone who has used Rust). Videos are starting to appear on the CppCon Youtube channel.

A Microsoft blog says something about their plans to rejuvenate MSVC. "We will continue to invest in improving our compiler with a goal towards making it fully standards compliant".

On the mailing lists

LLVM commits

  • The AArch64 machine reassociation code has been refactored to be target-independent. r248164.

  • LLVM's SafeStack now supports Android. r248405.

  • A new target hook has been added for optimizing register copies. r248478.

  • Operand bundles are now supported for CallInst and InvokeInst. Initial support was also added to LLVM bitcode. r248527, r248551.

Clang commits

  • The iOS/OSX localizability checks have been improved. r248350.

  • Some more PS4 toolchain code landed. r248546.

Other project commits

  • The new ELF linker should now be able to create binaries for FreeBSD. r248554.

  • The new ELF linker gained initial AArch64 support. r248641.

by Alex Bradbury (noreply@blogger.com) at September 28, 2015 11:16 AM

September 21, 2015

LLVM Blog

LLVM Weekly - #90, Sep 21st 2015

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

News and articles from around the web

The ISO C++ committee have started putting together a set of C++ Core Guidelines. The document describes itself as a set of guidelines for using C++ well, with the intention that adherence to the rules could be checked by an analysis tool. Bjarne Stroustrup and Herb Sutter are acting as editors for this project.

A reddit user has posted a detailed description of how they use libclang to generate reflection data for C++.

Andrew Chambers has written a blog post about his use of fuzzing to look for ABI bugs.

This short and sweet blog post introduces the clazy static checker, a simple checker for some common suboptimal uses of Qt types. There are plenty of ideas in the comments for further analyses that might be useful.

On the mailing lists

LLVM commits

  • Assert builds will now produce human-readable numbers to identify dumped SelectionDAG nodes. "0x7fcbd9700160: ch = EntryToken" becomes "t0: ch = EntryToken". r248010.

  • Basic support for reading GCC AutoFDO profiles has landed. r247874.

  • The llvm-mc-fuzzer tool has been documented. r247979.

  • The llvm.invariant.group.barrier intrinsic was born. r247711.

  • The LLVM default target triple can now be set to the empty string at configure time. r247775.

Clang commits

  • AST matcher functions have been renamed to match the AST node names directly. This is a breaking change. r247885, r247887.

  • The static analyzer gained a new Objective-C checker. DynamicTypeChecker will check for cases where the dynamic and static type of an object are unrelated. r248002.

Other project commits

  • The LLD COFF linker has gained some extra parallelisation. Self-link time has now improved from 1022ms to 654ms. r248038, r248078.

  • Support code was added to LLDB for recognising and printing Go types. r247629.

  • MemorySanitizer has been enabled for AArch64. r247809.

by Alex Bradbury (noreply@blogger.com) at September 21, 2015 06:51 PM

September 14, 2015

LLVM Blog

LLVM Weekly - #89, Sep 14th 2015

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

News and articles from around the web

I didn't spot any new LLVM-related articles or news this week. As a reminder, I always welcome tips either via email or Twitter. Seeing as there's nothing new, now seems a good time to point you towards either Stephen Diehl's tutorial on implementing a JIT compiled language with Haskell and LLVM or Adrian Sampson's 'LLVM for grad students'.

On the mailing lists

  • James Knight is proposing to deprecate and remove the old SelectionDAG scheduler, given that machine schedulers are now the preferred approach. He notes that a number of in-tree targets still use the SelectionDAG scheduler. It seems there is support for this plan.

  • Jauhien is curious about the availability of a C API for the ORC JIT, with the motivating use case here being to provide a binding for Rust. The main concern is that the ORC API is not yet stable, meaning it's not feasible to provide stable C bindings. The proposal is they live in llvm/include/llvm-c/unstable.

  • Joseph Tremoulet has a whole bunch of questions about addrspacecast semantics, and Chandler Carruth has a whole bunch of answers.

  • David Chisnall has a useful response to a question about implementing LLVM intrinsics with multiple return values. As he points out, this is usually done by returning a struct.

LLVM commits

  • A major modification of LLVM'a alias analysis manager has landed in order to port it to the new pass manager. See the commit message for full details. r247167.

  • The scalar replacement of aggregates (SROA) pass has been ported to the new pass manager. In the commit message, Chandler comments he hopes this serves as a good example of porting a transformation pass with non-trivial state to the new pass manager. r247501.

  • The GlobalsModRef alias analysis pass is now enabled by default. r247264.

  • Emacs users, rest your aching pinky fingers for a moment and rejoice. A range of improvements for the Emacs LLVM IR mode have landed. r247281.

  • The AArch64 backend can now select STNP, the non-temporal store instruction (this hints that the value need not be kept in cache). r247231.

  • Shrink wrapping optimisations are enabled on PPC64. r247237.

  • A whole bunch of StringRef functions have been sprinkled with the ALWAYS_INLINE attribute so as to reduce the overhead of string operations even on debug LLVM builds. Chandler has also been making other changes to improve the performance of check-llvm with a debug build. r247253.

  • The LLVM performance tips document has been extended to detail the use of allocas and when to specify alignment. r247301.

  • The hasLoadLinkedStoreConditional TargetLoweringInformation callback has now been split in to bool shouldExpandAtomicCmpXchgInIR(inst) and AtomicExpansionKind shouldExpandAtomicLoadInIR(inst). r247429.

Clang commits

  • A new control-flow integrity variant has been introduced, indirect function call chacking (enabled with -fsanitize=cfi-icall). This checks the dynamic type of the called function matches the static type used at the call. r247238.

  • A new -analyzer-config option is available to modify the size of function that the inliner considers as large. r247463.

  • Clang will now try much harder to preserve alignment information during IR-generation. r246985.

  • The __builtin_nontemporal_store and __builtin_nontemporal_load builtins have been introduced. r247104, r247374.

Other project commits

  • libcxx gained implementations of Boyer-Moore and Boyer-Moore-Horspool searchers (for the language fundamentals technical specification). r247036.

  • A trivial dynamic program linked with the new ELF lld now works with musl's dynamic linker. r247290.

  • LLD's COFF linker learned to merge cyclic graphs, which means self-linking now produces a 27.7MB rather than a 29.0MB executable. MSVC manages to produce a 27.1MB executable, so there is still room for improvement. r247387.

by Alex Bradbury (noreply@blogger.com) at September 14, 2015 03:03 PM

September 07, 2015

LLVM Blog

LLVM Weekly - #88, Sep 7th 2015

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

News and articles from around the web

The biggest news from the past week is of course the release of LLVM and Clang 3.7. See the LLVM release notes and the Clang release notes for more details.

Slides from the 2015 GNU Tools Cauldron are now available online.

Version 1.12 of TCE, the TTA-based co-design environment has been released.

On the mailing lists

LLVM commits

  • The LLVM plugin for the gold linker now supports parallel LTO code generation. r246584.

  • The 'unpredictable' metadata annotation is now supported. This can be used to signal that a branch or switch is unpredictable. r246888.

  • A tool built on libFuzzer to fuzz llvm-as has been added. r246458.

  • The FunctionAttrs pass learned to infer nonnull attributes on returns. r246476.

  • Work on Windows exception handling continues with the addition of the cleanupendpad instruction and the llvm.eh.exceptionpointer intrinsic. r246751, r246752.

Clang commits

  • Basic support for the WebAssembly target landed in Clang. Basic codegen is supported, but not yet assembling or linking. r246814.

  • Clang will now warn when you reference object members from a handler of a constructor/destructor function-try-block. r246548.

  • Clang learnt the __builtin_unpredictable builtin, which will generate the newly added unpredictable metadata. r246699.

Other project commits

  • The new ELF lld linker gained basic archive file support. r246886.

  • Language plugins in LLDB can now provide data formatters. r246568.

by Alex Bradbury (noreply@blogger.com) at September 07, 2015 05:57 PM

September 01, 2015

LLVM Blog

LLVM 3.7 Release

It is my pleasure to announce that LLVM 3.7.0 is now available!

Get it here: http://llvm.org/releases/

This release contains the work of the LLVM community over the past six months: full OpenMP 3.1 support (behind a flag), the On Request Compilation (ORC) JIT API, a new backend for Berkeley Packet Filter (BPF), Control Flow Integrity checking, as well as improved optimizations, new Clang warnings, many bug fixes, and more.

For details on what's new, see the release notes [LLVM, Clang].

Many thanks to everyone who helped with testing, fixing, and getting the release into a good state!

Special thanks to the volunteer release builders and testers, without whom this release would not be possible: Dimitry Andric, Sebastian Dreßler, Renato Golin, Pavel Labath, Sylvestre Ledru, Ed Maste, Ben Pope, Daniel Sanders, and Nikola Smiljanić!

If you have any questions or comments about this release, please contact the community on the mailing lists. Onwards to 3.8!

by Hans Wennborg (noreply@blogger.com) at September 01, 2015 09:15 PM

August 31, 2015

LLVM Blog

LLVM Weekly - #87, Aug 31st 2015

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

It's a bank holiday weekend here in the UK, so apologies that you're reading this a few hours later than usual. As a quick reminder, if you're able to be in Geneva for the 9th-11th October then you should definitely come along to ORConf.

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

News and articles from around the web

At the time of writing, LLVM 3.7.0 has not yet seen its official release, but it has been tagged. The final release should be out within the next day or so. Congratulations to everyone involved.

The deadline for submissions to the LLVM in HPC workshop has been extended to Friday, September 4th.

Save the date! The next Cambridge LLVM Social will be on Wednesday 30th September.

On the mailing lists

LLVM commits

  • The 'kaleidoscope' tutorial has seen a major update. Now, rather than introducing MCJIT it describes how to use ORC, building a custom JIT called KaleidoscopeJIT. r246002.

  • WebAssembly backend implementation work has been continuing over the past few weeks. The individual commits tend to be small and focused (as good commits should be). I mainly wanted to include a mention to highlight how work is ongoing. e.g. this recent commit added support for emitting simple call s-expressions. r245986.

  • The documentation on statepoints now has more to say about base pointers and related assumptions and optimisations. r246103.

  • Constant propagation is enabled for more single precisions math functions, such as acosf, powf, logf. r246194.

  • The function llvm::splitCodeGen has been introduced in order to support the implementation of parallel LTO code generation. It uses SplitModule to split the module in to linkable partitions that are distributed among threads to be codegenned. r246236.

  • There's been another change to DebugInfo. DISubprogram definitions must now be marked as distinct. The commit message includes a suggested script for updating IR. r246327.

  • Chandler has been doing some refactoring of the ARM target parsing code with the hope of making it more efficient. He's reduced the cases where the code is called, which has a noticeable effect on some LLVM timings (e.g. check-llvm with non-optimized builds is 15 seconds faster). r246370, r246378.

Clang commits

  • A NullabilityChecker has been introduced, which is designed to catch a number of nullability-related issues. r246105.

Other project commits

  • ThreadSanitizer is now enabled for AArch64 with 42-bit virtual addressing on Linux. r246330.

  • libcxx now contains release goals for 3.8 in its TODO.txt. This includes the Filesystem TS and the asynchronous I/O TS. r245864.

  • LLD's ELF linker gained a basic AMDGPU ReaderWriter that enables it to emit binaries that can be consumed by the HSA runtime. r246155.

  • LLD's COFF linker gained support for parallel LTO code generation. r246342.

  • LLDB now supports hardware watchpoints on ARM. r245961.

  • The concept of 'language plugins' was introduced to LLDB. These will provide language-specific data formatters or expression evaluation. r246212.

by Alex Bradbury (noreply@blogger.com) at August 31, 2015 12:03 PM

August 24, 2015

LLVM Blog

LLVM Weekly - #86, Aug 24th 2015

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

News and articles from around the web

The LLVM Foundation has been granted 501(c)(3) non-profit status. This means contributions are tax-deductible for US tax payers.

LLVM 3.7-rc3 has been tagged. This is the final release candidate and 3.7.0 final is expected very shortly.

The paper Fast and Precise Symbolic Analysis of Concurrency Bugs in Device Drivers makes use of Clang and LLVM as part of its verification flow.

Good news everyone! The deadline for submissions for the 2015 LLVM Developers' meeting has been extended to August the 25th.

On the mailing lists

LLVM commits

  • TransformUtils gained the module splitter, which splits a module into linkable partitions and is intended to be used for parallel LTO code generation. r245662.

  • MergeFunctions is now closer to being deterministic. r245762.

  • ScalarEvolution has been ported to the new pass manager. r245193.

  • The 'kaleidoscope' tutorials on creating a language backend using LLVM are now partially updated to use C++11 features and idioms. r245322.

  • The peephole optimiser learned to look through PHIs to find additional register sources. r245479.

Clang commits

  • The ObjCGenericsChecker will catch type errors related to lightweight generics in Objective-C. r245646.

Other project commits

  • compiler-rt has gained implementations of some of the missing ARM EABI runtime functions. r245648.

  • libcxx gained a whole bunch of Sphinx-based documentation. r245788.

by Alex Bradbury (noreply@blogger.com) at August 24, 2015 09:56 AM

August 20, 2015

LLVM Blog

LLVM Foundation Granted 501(c)(3) Nonprofit Status

The LLVM Foundation is proud to announce it has been officially approved as a public charity with tax-exempt status under Section 501(c)(3) of the United States Internal Revenue Code. Contributions donated to the LLVM Foundation are fully tax deductible, retroactive to the organization establishment date of May 5, 2014.

The LLVM Foundation's primary mission is to provide accessible and informative educational tools for the LLVM Project and compiler technology to the general public. These educational tools include events such as the annual LLVM Developers' meeting. The LLVM Foundation also gives grants or scholarships to other nonprofit organizations and individuals (such as student travel to LLVM Foundation events). Lastly, the LLVM Foundation funds the infrastructure necessary to support the LLVM Project.

We hope to begin accepting donations online before the end of the year.  If you are interested in contributing, please contact your employer: they may be willing to match contributions to a 501(c)(3) charity.

The IRS letter granting the LLVM Foundation 501(c)(3) tax-exempt status is available upon request until we can get it posted online. Please contact Tanya Lattner (tanyalattner@llvm.org), President of the LLVM Foundation.

by Tanya (noreply@blogger.com) at August 20, 2015 03:16 PM

August 17, 2015

LLVM Blog

LLVM Weekly - #85, Aug 17th 2015

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

If you're interested in open source hardware, lowRISC, RISC-V, OpenRISC, and more then consider joining us at ORConf 2015 in October. I'm also looking for talk submissions.

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

News and articles from around the web

Videos from April's EuroLLVM are now online.

The deadline for the 2015 LLVM Developer's Meeting call for papers is rapidly approaching. Get your proposal in by August 20th, 11:59PM PDT.

A new paper covering the AST generation techniques used in Polly in great detail has been published in the July issue of TOPLAS. You can read the preprint here.

The Customizable Naming Convention Checker (CNCC) is a new Clang-based tool that can be used to validate class, field, variable, and namespace naming conventions against a chosen regular expression.

EvilML is a deliciously terrifying compiler that compiles ML to C++ template language.

On the mailing lists

LLVM commits

  • MergeFunctions has been sped up substantially by hashing functions and comparing that hash before performing a full comparison. This results in a speedup of 46% for MergeFunctions in libxul and 117% for Chromium. r245140.

  • i64 loads and stores are now supported for 32-bit SPARC. This is a little fiddly to support as the LDD/STD instructions need a consecutive even/odd pair of 32-bit registers. r244484.

  • Machine basic blocks are now serialized using custom syntax rather than YAML. A later commit documented this syntax. r244982, r245138.

  • A new TargetTransformInfo hook has been added for specifying per-target defaults for interleaved accesses. r244449.

  • The llvm.loop.unroll.enable metadata was introduced. This will cause a loop to be unrolled fully if the trip count is known at compiler time and partially if it isn't (unlike llvm.loop.unroll.full which won't unroll a loop if the trip count isn't known). r244466.

  • Rudimentary support for the new Windows exception handling instructions has been introduced. r244558.

  • Token types have been added to LLVM IR. r245029.

  • The BPF backend gained documentation and an instruction set description. r245105.

Clang commits

  • The WebKit brace style is now supported by clang-format. r244446.

Other project commits

  • Statistics collection in the OpenMP runtime has been tidied up and expanded. r244677.

by Alex Bradbury (noreply@blogger.com) at August 17, 2015 10:22 AM

August 10, 2015

LLVM Blog

LLVM Weekly - #84, Aug 10th 2015

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

News and articles from around the web

Adrian Sampson has written a fantastic introduction to LLVM. It's titled LLVM for Grad Students, but it should be useful for anybody looking to use LLVM or just wanting to understand it better.

Brandon Holt has written up a short and helpful post giving hints and tips on debugging LLVM.

The move of the mailing lists from UIUC on to lists.llvm.org is now complete. All public LLVM-related mailing lists are shown here. List addresses have now changed to listname@lists.llvm.org.

There's been some exciting activity in the world of GCC. Support for the draft C++ Concepts TS has been committed. A draft of the technical specification is available here. Additionally, Nick Clifton has posted a useful summary of GNU toolchain developments for July/August.

On the mailing lists

LLVM commits

  • A handy new LLVM Support header was introduced. The TrailingObjects template class abstracts away reinterpret_cast, pointer arithmetic, and size calculation needed for the case where a class has some other objects appended to the end of it. r244164.

  • Initial documentation for the Machine IR serialization format has been written. r244292.

  • Uniquable DICompilerUnits have been disallowed. Old bitcode will be automatically upgraded and the sed script in the commit message should be useful for updating out-of-tree testcases. r243885.

  • All of the TargetTransformInfo cost APIs now use int rather than unsigned. r244080.

Clang commits

  • A new checker for code-level localizability issues on OSX/iOS was born. It will warn about the use of non-localized NSStrings passed to UI methods and about failing to include a comment in NSLocalizedString macros.
    r244389.

  • New AST matchers have been introduced for constructors that are default, copy, or move. r244036.

Other project commits

  • The old COFF linker in LLD has been removed in favour of the new, faster, and simpler implementation. r244226.

  • ThreadSanitizer is now enabled for AArch64. r244055.

by Alex Bradbury (noreply@blogger.com) at August 10, 2015 04:01 PM

August 03, 2015

LLVM Blog

LLVM Weekly - #83, Aug 3rd 2015

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

News and articles from around the web

The CodeChecker static analysis infrastructure built on Clang Static Analyzer has been released. The slides from the talk at EuroLLVM earlier this year give a good overview.

LLVM/Clang 3.7 RC2 has been tagged. Time to get testing.

The implementation of the Picon Control Flow Integrity protection mechanism has been released. See also the associated paper Picon: Control Flow Integrity on LLVM IR.

On the mailing lists

LLVM commits

  • A new exception handling representation has been introduced for MSVC compatibility. The commit includes the appropriate updates to the LLVM language reference. r243766.

  • A test to check bitcode compatibility has been added. This will help ensure the bitcode format produced by an X.Y release is readable by the following X.Z releases. r243779.

  • The lli documentation has been updated and now better explains its purpose. r243401.

  • LLVM gained a target-independent thread local storage (TLS) implementation. r243438.

  • A reverse(ContainerTy) range adapter was added. r243581.

Clang commits

  • The method for emitting metadata for loop hint pragmas has been modified, using CGLoopInfo. r243315.

  • Clang learned to pass -Wa,-mfpu, -Wa,-mhwdiv, and -Wa,-mcpu to the integrated assembler. r243353.

  • Initial support for Open MP 4.1's extended ordered clause was added. r243635.

Other project commits

  • lldb is starting to gain support for indicating when you are debugging a function that has been optimized. r243508.

by Alex Bradbury (noreply@blogger.com) at August 03, 2015 01:21 PM

July 27, 2015

LLVM Blog

LLVM Weekly - #82, Jul 27th 2015

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

I'd just like to highlight how much I really do appreciate people sending me links for inclusion, e.g. LLVM-related blog posts or new releases of software using LLVM (feature releases rather than simple bugfix updates). I'm not omniescent - if an interesting blog post or software release goes unmentioned here, I probably just didn't know about it!

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

News and articles from around the web

The call for papers for the 2015 LLVM Developers' meeting has now gone out. The submission deadline is August 20th. Registration is also now open.

John Regehr and his collaborators working on Souper have shared some initial results from the synthesizing superoptimizer. John is very interested in collecting representative IR from frontends other than Clang. There is also some discussion about these results on the mailing list.

Microsoft have open sourced their GDB/LLDB 'debug engine'.

On the mailing lists

LLVM commits

  • dsymutil gained support for one-definition-rule uniquing for C++ code. When linking the DWARF for a debug build of clang, it generates a 150M dwarf file instead of 700M. r242847.

  • The last remnant of the AliasAnalysis legacy update API have been removed. r242881.

  • LoopUnswitch can now unswitch multiple trivial conditions in a single pass invocation. r243203.

Clang commits

  • Clang gained the isFinal() AST matcher. r243107.

Other project commits

  • A new ELF linker has been born, based on the PE/COFF linker. r243161.

  • libcxx gained a default searcher for std::experimental::search. r242682.

by Alex Bradbury (noreply@blogger.com) at July 27, 2015 10:01 AM

July 20, 2015

LLVM Blog

LLVM Weekly - #81, Jul 20th 2015

Welcome to the eighty-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'm "on holiday" (at EuroPython) this week in Bilbao, mostly helping out the Raspberry Pi team with the education track. Do say hello, particularly if you want to chat lowRISC, LLVM, or Raspberry Pi.

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

News and articles from around the web

LLVM 3.6.2 has been released.

LLVM and Clang 3.7 has been branched.

The team behind Pyston, the LLVM-based Python JIT have written a blog post about their new object code caching feature.

On the mailing lists

LLVM commits

  • The API to determine callee-save registers has been rewritten. r242165.

  • The 'debugger tuning' concept has been introduced, allowing the specification of the debugger the debug info should be optimised for. This defaults to lldb on OS X and FreeBSD and GDB for everything else (other than PS4, which defaults to the SCE debugger). r242388.

  • Intrinsics for absolute difference operations have been introduced. r242409.

  • The PostRAScheduler has been disabled for the Apple Swift CPU and MachineScheduler is used in place. The commit message argues PostRAScheduler is not a good fit for out-of-order architectures and suggests the same switch might be worth while for other ARM OoO CPUs. r242500.

Clang commits

  • Support for armv7-windows-gnu targets has been added to the Clang front-end. r242292.

  • The clang module container format is now selectable from the command line (raw or obj). r242499.

  • A minimal AMDGPU toolchain configuration has been added. r242601.

Other project commits

  • LLD now supports MIPS big-endian targets. r242014.

  • LLDB's gdbserver is moving towards being a single-threaded application. r242018.

  • The OpenMP CMake build system has been massively refactored. r242298.

by Alex Bradbury (noreply@blogger.com) at July 20, 2015 01:34 PM

July 13, 2015

LLVM Blog

LLVM Weekly - #80, Jul 13th 2015

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

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

News and articles from around the web

The 2015 LLVM Developers' Meeting has been announced. It will take place on October the 29th and 30th in San Jose, California. Registration information and a call for papers will be sent out later in the month.

LLVM/Clang 3.6.2 has been tagged. All being well, we can expect 3.6.2 to be released soon.

On the mailing lists

LLVM commits

  • The Hexagon backend gained a BitTracker class. This is intended to be target independent. As described at the top of BitTracker.cpp, this is intended to be used with a target-specific machine instruction evaluator. There have been some other large additions to the Hexagon backend this week too. I hope the authors will consider given another talk on their work at some point.
    r241595.

  • llc learnt the run-pass option, which will run one specific code generation pass only. r241476.

  • LLVM now has documentation on its inline assembly!
    r241698.

  • The llvm.frameescape and llvm.framerecover intrinsics have been renamed to localescape and localrecover. r241463.

  • Various refactoring commits have been made with the aim of having a single DataLayout used during compilation, owned by the module.
    r241775.

  • A new llvm.canonicalize intrinsics has been introduced, intended to be used to canonicalize floating point values. r241977.

  • The new argmemonly attribute can be used to mark functions that can only access memory through its argument pointers. r241979.

Clang commits

  • A few patches landed in Clang improving Objective-C support. This includes parsing, semantic analysis, and AST support for Objective-C type parameters, support for Objective-C type arguments, the __kindof type qualifier. Douglas Gregor has more to say about these changes on the mailing list. r241541, r241542, r241548, and more.

  • Clang will attached the readonly or readnone attributes when appropriate to inline assembly instructions, meaning the inline asm will not be treated as conservatively. e.g. in some cases an inline asm block could be hoisted out of a loop. r241930.

  • PCH (pre-compiled headers) are now wrapped in an object file. r241690, r241620.

  • Clang now recognises the GCC-compatible -fprofile-generate and -fprofile-use flags. r241825.

Other project commits

  • libcxx add try_emplace and insert_or_assign to map and unordered_map, as specified in N4279. r241539.

  • The new LLD COFF linker now has basic support for x86 (it was previously x86-64 only). r241857.

by Alex Bradbury (noreply@blogger.com) at July 13, 2015 04:50 PM

July 06, 2015

LLVM Blog

LLVM Weekly - #79, Jul 6th 2015

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

Last week I was in Berkeley for the second RISC-V conference. If you weren't able to make it, worry not because I liveblogged both day one and day two.

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

News and articles from around the web

Stephen Cross has released llvm-abi, a library for generating LLVM IR that complies with platform ABIs.

This is a rather cute implementation of Tetris in C++ header files, compatible with Clang.

On the mailing lists

LLVM commits

  • The initial skeleton of the WebAssembly backend has been committed. It is not yet functional. r241022.

  • DIModule metadata nodes have been introduced. A DIModule is meant to be used to record modules importaed by the current compile unit. r241017.

  • New exception handling intrinsics have been added for recovering and restoring parent frames. r241125.

Clang commits

  • Clang gained support for the x86 builtin __builtin_cpu_supports. r240994.

  • The Clang man pages have been converted to Sphinx (from .pod). r241037.

Other project commits

  • libcxx gained shared_mutux. r241067.

  • LLD has gained some generally applicable optimisations. e.g. devirtualizing SymbolBody and compacting its in-memory representation. r241001.

  • LLD's COFF linker can now link a working 64-bit debug build of Chrome. chrome.dll takes 24 seconds (vs 48 seconds for linking it with MSVC). r241318.

  • LLDB grew an example of scripted steps in Python. r241216.

by Alex Bradbury (noreply@blogger.com) at July 06, 2015 11:23 PM

July 01, 2015

OpenMP Runtime Project

New code release

We are excited to announce the next release of the Intel® OpenMP* Runtime Library at openmprtl.org. This release aligns with Intel® Parallel Studio XE 2016 Composer Edition.

New Features

Bug Fixes

by mad\jlpeyton at July 01, 2015 07:28 PM

June 29, 2015

LLVM Blog

LLVM Weekly - #78, June 29th 2015

Welcome to the seventy-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'm in the Bay Area this week for the second RISC-V workshop where my colleague and I will of course be talking about lowRISC. If you're not able to make it, keep an eye on the lowRISC blog which I intend to keep updating semi-live with notes from the talks and presentations.

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

News and articles from around the web

Hans Wennborg has shared the release plan for LLVM/Clang 3.7. This would see the release branch created on 14th July, with a final release targeted for 21st August.

A detailed analysis of the results of the "What is C in practice" survey has now been posted. The survey gained around 300 responses, and aims to help guide the definition of a formal model for the de facto standard of C (i.e. C as it is used rather than purely as specified in the ISO standard).

The 3.6.2-rc1 LLVM/Clang release has been tagged. As always, testing is encouraged.

On the mailing lists

Unfortunately at the time of writing GMANE seems to be having some problems, so for this week I'll be using links to the pipermail archives of the relevant mailing list posts.

LLVM commits

  • The InterleavedAccess pass has been introduced to identify interleaved memory accesses so they can be transformed into target-specific intrinsics. r240751.

  • Initial serialisation of machine instructions has been added, representing MachineInstructions in YAML. r240295, r240425, and more.

  • The CaptureTracking pass has been optimised to improve performance on very large basic blocks. r240560.

  • A parser for LLVM stackmap sections has been added and made available through llvm-readobj. r240860.

Clang commits

  • The recently added nullability attributes have been extensively documented. r240296.

  • constexpr can now be specified in condition declarations. r240707.

Other project commits

  • The README for the COFF linker in LLD has been updated with new performance numbers. It's now 3.5 seconds to self-host (was previously 5 seconds), and this compared 7 seconds with the MSVC linker and 30 seconds with the old LLD. r240759.

  • The safestack TODO list in compiler-rt has been updated. r240473.

  • LLD gained support for thread-local storage in MachO objects. r240454.

  • Polly has had a meaningful improvement in compile time through enabling the small integer optimisation of the ISL (Integer Set Library). Polybench benchmarks on average take 20% less time to compile. r240689.

by Alex Bradbury (noreply@blogger.com) at June 29, 2015 10:51 AM

June 22, 2015

LLVM Blog

LLVM Weekly - #77, Jun 22nd 2015

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

I'll be in California next week for the second RISC-V workshop. Me and my colleague Wei will both be giving talks about recent lowRISC progress. Say hi if you're going to be there. I might have some spare time towards the end of the week too if anyone wants to meet up.

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

News and articles from around the web

WebAssembly has been announced. It is a new collaboration between browser vendors to define a new binary executable format that can be used as a compilation target. A good summary is available here on the emscripten mailing list.

Tilmann Scheller has written up a pair of blog posts about improving build times of Clang. He steps through a wide range of generic approaches (using Ninja, ccache, the gold linker, LTO+PGO in the host compiler etc etc) and some specific to Clang/LLVM.

The Cambridge LLVM Social will be taking place on Wed 24th June, 7.30pm at the Blue.

On the mailing lists

LLVM commits

  • Some initial support for 'fault maps' and a FAULTING_LOAD_OP, intended for use in a managed language runtime, has been added. The new ImplicitNullChecks pass will fold null checks into nearby memory operations. r239740, r239743.

  • The SafeStack pass to protect against stack-based memory corruption errors has been added. r239761.

  • All temporary symbols are now unnamed. This saves a small amount of memory. r240130.

  • There's been some enhancement to the heuristics for switch lowering. r240224.

Clang commits

  • The -fsanitize-trap= flag has been introduced, which will be used to control if the given sanitizer traps upon detecting an error. r240105.

  • Appropriate bitsets for use by LLVM's control flow integrity implementation can now be emitted for the Microsoft ABI. r240117.

  • Kernel AddressSanitizer now has basic support. r240131.

  • Clang learned to recognise type nullability specifiers. r240146.

Other project commits

  • LLDB learnt how to use hardware watchpoints for MIPS. r239991.

  • Compression support has been added to LLDB's implementation of the gdb-remote protocol. r240066.

by Alex Bradbury (noreply@blogger.com) at June 22, 2015 11:52 AM

June 15, 2015

LLVM Blog

LLVM Weekly - #76, Jun 15th 2015

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

News and articles from around the web

The big news this week is that Apple have announced Swift 2.0 and, perhaps more importantly, that Swift will be open source later this year. The intention is that iOS, OS X and Linux will be supported at release.

On the mailing lists

LLVM commits

  • The loop vectorizer gained an optimisation for interleaved memory access. It is disabled by default but can be turned on using -enable-interleaved-mem-accesses=true. An AArch64InterleavedAccess pass was also added. r239291, r239514.

  • A prototype for 32-bit SEH (Structured Exception Handling) has been added. r239433.

  • LLVM has grown LibDriver and llvm-lib, intended to provide a lib.exe compatible utility. r239434.

  • x86 gained a new reassociation MachineCombiner optimisation to increase ILP. r239486.

  • The R600 backend has now been renamed to AMDGPU. r239657.

Clang commits

  • Support for C99 partial re-initialization behaviour has been implemented. r239446.

  • Clang gained support for the BPF backend. r239496.

  • The loop vectorize pragma now recognises assume_safety. This will tell loop access analysis to skip memory dependency checking. r239572.

  • The target attribute is now supported. Much like GCC's target attribute, it allows adding subtarget features and changing the CPU for a particular function. r239579.

Other project commits

  • The COFF linker in LLD continues to get faster. r239332, r239292.

  • LLD grew a TypeSystem interface to support adding non-clang languages (though it seems it's reverted for now). r239360.

by Alex Bradbury (noreply@blogger.com) at June 15, 2015 04:49 PM

June 08, 2015

LLVM Blog

LLVM Weekly - #75, Jun 8th 2015

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

News and articles from around the web

Botond Ballo has posted a wonderfully thorough summary of the recent Lenexa C++ standards meeting, even including a table to summarise the status of various major proposals.

I have somehow neglected to mention the Crystal language previously. It is a statically typed language with syntax inspired by Ruby which (of course) compiles using LLVM. It was discussed last week on Hacker News.

icGrep has been released. It makes use of the 'Parabix' text representation and LLVM for high performance regex matching. More details are available at the icGrep homepage.

The winners of the 7th Underhanded C Contest have now been announced online. Congratulations to the winner, Karen Pease, for creating such a monstrous piece of code.

On the mailing lists

  • Chandler Carruth has posted a summary of a recent in-person discussion about LLD's future and design. It looks like this was a very positive meeting with agreement in important areas. The recently contributed experimental COFF linker is going to be evaluated to see if its linking model would be appropriate for Darwin. If so, the hope is work can focus on adopting that as the standard model. If not, more work will need to be done on refactoring LLD and making sure that code which makes sense to be shared is.

  • Christos Margiolas has been working as an intern at the Qualcomm Innovation Center on support for heterogeneous compute, including transparent offloading of loops or functions to accelerators. He is asking for feedback and looking to see if there is interest in getting this upstream. He has shared a slide deck which gives more details.

  • Woodrow Barlow is interested in implementing a new PIC backend for LLVM. Renato Golin gave a very thorough and helpful response about how you might proceed.

  • Frank Winter is looking for a way to replace a sequence of repetitive code with a loop. It was pointed out that the LLVM loop reroll pass should be helpful for this, but it does need to run on an existing loop. This would mean it requires modification or the IR should be modified to introduce a trivial loop before running the reroll pass.

  • Philip Reames has posted an RFC on adding a liveoncall parameter attribute. This would be used to leave an argument marked as live even if it isn't actually used (so it might be later inspected at runtime). Chris Lattner queried whether adding an intrinsic might be a better approach.

LLVM commits

  • LLVM gained support for the new AArch64 v8.1a atomic instructions. r238818.

  • The MPX (Intel Memory Protection eXtensions) feature bit and bound registers are now supported on the X86 backend. r238916.

  • MIPS FastISel gained more instruction and intrinsic implementations. r238756, r238757, r238759.

  • With the introduction of MCSymbolELF, the base MCSymbol size is now reduced to 48 bytes on x86-64. r238801.

  • Work has started on porting AliasAnalysis to the new pass manager. r239003.

  • The BPF backend now supports big and host endian, in addition to the previously supported little endian. r239071.

  • The naming and structure of the recently added unroll heuristics has been modified. r239164.

Clang commits

  • -mcpu for ARM will now ignore the case of its arguments for ARM. r239059.

  • A mass of predefined vector functions for PowerPC has been added. r239066.

  • The concept and requires keywords (as used in the C++ Concepts TS) are now lexed. Let's hope this starting point is followed up with work towards full concepts support in the coming months. r239128.

Other project commits

  • The lld COFF linker gained an initial implementation of link-time optimisation. r238777.

  • LLDB gained support for software emulation of the MIPS64 branch instructions. r238820.

  • libiomp5 is now libomp. r238712.

by Alex Bradbury (noreply@blogger.com) at June 08, 2015 11:40 AM

June 01, 2015

LLVM Blog

LLVM Weekly - #74, Jun 1st 2015

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

You may be interested in the second RISC-V workshop, which will be held in Berkeley June 29-30. Early bird registration ends today, but academics can register for free. My colleague Wei and I will be there representing lowRISC.

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

News and articles from around the web

MPI-Checker, a static analysis tool for MPI code has been released. It is of course implemented using Clang's Static Analyzer framework.

The LLVM-HPC2 workshop will be held on November 15th, co-located with SC15. The call for papers has been published. Submissions are due by September 1st.

On the mailing lists

LLVM commits

  • Codegen for memcpy on Thumb2 has been improved to make use of load/store multiple (more details of how this works in the commit message, worth a read for those interested). r238473.

  • Popcount on x86 will now be implemented using a lookup table in register technique. r238636, r238652.

  • Work continues on reducing peak memory usage through optimisations to debug info. r238364.

  • Initial support for the convergent attribute has landed. r238264.

  • The documentation about the current state of LLVM's Phabricator has been updated along with a call for volunteers to help develop necessary improvements and modifications to Phabricator's PHP codebase. r238295.

  • MCJIT gained support for MIPS64r2 and MIPS64r6. r238424.

Clang commits

  • Clang's handling of -fopenmp has been rewritten. r238389.

  • The user documentation on profiling has been extended. r238504.

Other project commits

  • A new PE/COFF section-based linker has been added to lld. This follows on from discussions about the direction of lld and whether it makes sense to build on top of the atom model. The linker is able to self-link on Windows and is significantly faster than the current implementations (1.2 seconds vs 5 seconds, even without multi-threading). It also takes only 250MB of RAM to self-link vs 2GB. r238458.

  • LLDB on Windows can now demangle Linux or Android symbols. r238460.

by Alex Bradbury (noreply@blogger.com) at June 01, 2015 01:35 PM

May 25, 2015

LLVM Blog

LLVM Weekly - #73, May 25th 2015

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

News and articles from around the web

The LLVM blog has properly announced full support for OpenMP 3.1 in Clang.

The Clang-derived Zapcc has had some attention this week. It claims higher compilation speeds than the baseline Clang or other compilers. Yaron Keren, the principal developer has shared many more details about its implementation on the Clang mailing list.

On the mailing lists

LLVM commits

  • The dereferenceable_or_null attribute will now be exploited by the loop environment code motion pass. r237593.

  • Commits have started on the 'MIR serialization' project, which aims to print machine functions in a readable format. r237954.

  • A GCStrategy for CoreCLR has been committed alongside some documentation for it. r237753, r237869.

  • libFuzzer gained some more documentation. r237836.

  • libFuzzer can now be used with user-supplied mutators. r238059, r238062.

Clang commits

  • -fopenmp will turn on OpenMP support and link with libiomp5 (libgomp can alternatively be specified). r237769.

  • The -mrecip flag has been added to match GCC. r238055.

Other project commits

  • C++1z status for libcxx has been updated. r237606.

  • std::bool_constant and uninitialized_copy() was added to libcxx. r237636, r237699.

  • libcxx gained a TODO list. Plenty of tasks that might be interesting to new contributors. r237813, r237988.

  • LDB has enabled debugging of multithreaded programs on Windows and gained support for attaching to process. r237637, r237817.

by Alex Bradbury (noreply@blogger.com) at May 25, 2015 04:39 PM

May 22, 2015

LLVM Blog

OpenMP Support

OpenMP support in Clang compiler is completed! Every pragma and clause from 3.1 version of the standard is supported in full, including combined directives (like ‘#pragma omp parallel for’ and ‘#pragma omp parallel sections’).  In addition, some elements of OpenMP 4.0 are supported as well. This includes “almost complete” support for ‘#pragma omp simd” and full support for ‘#pragma omp atomic’  (combined pragmas and a couple of clauses are still missing).

OpenMP enables Clang users to harness full power of modern multi-core processors with vector units. Pragmas from OpenMP 3.1 provide an industry standard way to employ task parallelism, while ‘#pragma omp simd’ is a simple yet flexible way to enable data parallelism (aka vectorization).

Clang implementation of OpenMP standard relies on LLVM OpenMP runtime library, available at http://openmp.llvm.org/. This runtime supports ARM® architecture processors, PowerPC™ processors, 32 and 64 bit X86 processors and provides ABI compatibility with GCC and Intel's existing OpenMP compilers.

To enable OpenMP, just add ‘-fopenmp’ to the command line and provide paths to OpenMP headers and library with ‘-I <path to omp.h> -L <LLVM OpenMP library path>’.

To run a compiled program you may need to provide a path to shared OpenMP library as well:

$ export LD_LIBRARY_PATH=<OpenMP library path>:$LD_LIBRARY_PATH
or:
$ export DYLD_LIBRARY_PATH=<OpenMP library path>:$DYLD_LIBRARY_PATH
on Mac OS X.

You can confirm that the compiler works correctly by trying this simple parallel C program:

#include <omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
    printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}

Compile it (you should see no errors or warnings):

$ clang -fopenmp -I <path to omp.h> -L <LLVM OpenMP library path> hello_openmp.c -o hello_openmp

and execute:

$ export [DY]LD_LIBRARY_PATH=<OpenMP library path>:$[DY]LD_LIBRARY_PATH
$ ./hello_openmp

You will see more than one “Hello” line with different thread numbers (note that the lines may be mixed together). If you see only one line, try setting the environment variable OMP_NUM_THREADS to some number (say 4) and try again.

Hopefully, you will enjoy using OpenMP and witness dramatic boosts of your applications’ performance!

by Alexey Bataev (noreply@blogger.com) at May 22, 2015 03:23 PM

May 18, 2015

LLVM Blog

LLVM Weekly - #72, May 18th 2015

Welcome to the seventy-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 of you may be interested that over at the lowRISC project, we've announced the full set of summer student projects we're supporting.

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

News and articles from around the web

The Rust programming language, which of course uses LLVM as its compiler backend, has just released version 1.0.

The next Cambridge LLVM Social will take place on Wednesday 20th May at the Cambridge Beer Festival.

On the mailing lists

LLVM commits

  • The ARM backend has been updated to use AEABI aligned function variants. r237127.

  • The heuristic for estimating the effect of complete loop unrolling has been reimplemented. r237156.

  • Statepoints are now 'patchable'. r237214.

  • Support for function entry count metadata has been added. r237260.

  • A new loop distribution pass has been born. It is off by default. r237358.

  • New SelectionDAG nodes have been added for signed/unsigned min/max. r237423.

  • A simple speculative execution pass, targeted mainly at GPUs has been added. r237459.

Clang commits

  • The little endian SPARC target has been added to clang. r237001.

  • clang-format's formatter has undergone some refactoring, which also led to a few bug fixes.r237104.

  • Documentation on adding new attributes has seen a significant update. r237268.

Other project commits

  • libcxx learnt std::experimental::sample r237264.

  • lldb has enabled multithreaded debugging on Windows. r237392.

  • lldb can now set and clear hardware watchpoints and breakpoints on AArch64. r237419.

  • lldb gained an assembly profiler for mips32. r237420.

by Alex Bradbury (noreply@blogger.com) at May 18, 2015 12:56 PM

May 11, 2015

LLVM Blog

LLVM Weekly - #71, May 11th 2015

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

News and articles from around the web

The implementation of OpenMP 3.1 in Clang/LLVM is now complete. Well done to everyone involved.

Most slides from the presentations at EuroLLVM 2015 are now online. Video is coming soon.

Version 3.5.1 of Clang UPC, the Unified Parallel C compiler has been released. The main change seems to be the move to Clang/LLVM 3.5.

The Pony Language, which features an LLVM backend has recently been released. It received quite a lot of discussion on Hacker News.

Many readers might be interested in this update from the last C++ standardization committee meeting.

IBM have posted some bounties for TSAN support and MSAN support for PPC64.

On the mailing lists

LLVM commits

  • A new 'shrink-wrap' pass has been added. It attempts to insert the prologue and epilogue of a function somewhere other than the entry/exit blocks. See the commit message for a motivating example. r236507.

  • Support for the z13 processor and its vector capabilities have been added to the SystemZ backend. r236520, r236521.

  • Documentation has been written for the new masked gather and scatter intrinsics. r236721.

  • The statepoint intrinsic has been extended to allow statepoints to be marked as tranditions from GC-aware code to nonGC-aware code. r236888.

Clang commits

  • Clang support for the z13 processor was added. r236531.

  • Thread-safe initialization using the MSVC 2015 ABI has been implemented. r236697.

  • User-friendly -fsanitize-coverage= flags are now available. r236790.

Other project commits

  • libiomp's CMake has been integrated into the LLVM CMake build system, so you can now checkout libiomp and have it built alongside llvm, clang and so on. r236534.

by Alex Bradbury (noreply@blogger.com) at May 11, 2015 09:42 AM

May 04, 2015

LLVM Blog

LLVM Weekly - #70, May 4th 2015

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

News and articles from around the web

Microsoft have announced their intention to make use of the Clang frontend on Windows.

Bjarne Stroustrup has recently been talking about potential C++17 features.

The Visual C++ developers are going to be open-sourcing their GDB/LLDB debug engine.

The projects accepted into Google Summer of Code for LLVM have been announced. Four student projects have been accepted.

The next Bay Area LLVM social is scheduled for 7pm on Thursday the 7th of May. Please sign up if you are attending.

On the mailing lists

  • Rui Ueyama has been doing quite a lot of work on LLD of late and has proposed an LLD improvement plan. In it, he proposes some major changes that would hopefully ease the path to LLD becoming a fully functional ELF, Mach-O, and PE-COFF linker. The two main proposals are to use the 'section' rather than the 'atom' model and to stop trying to bend the Unix model to work on other platforms, instead directly implementing the necessary native behaviour. There are understandably some concerns that this direction could result in LLD having to maintain essentially three linkers, but discussion is ongoing and much feedback seems positive.

  • Alex, who will be interning at Apple this summer has posted an RFC on a proposed machine level IR text serialisation format. It came out a little mangled on Gmane so you may prefer to read the pipermail rendering. A lot of the feedback revolves around the pros and cons of a YAML-based format..

  • Andrey Bokhanko suggests replacing libgomp with libiomp as the default OpenMP runtime library when using -fopenmp. Ultimately there seems to be agreement and the only issue seems to be on the library naming.

  • Nico Weber reports that although -gline-tables-only makes debug info much smaller, they've found with Chromium the resulting stackframes aren't that usable without function parameters and namespaces. The proposal is to add a new variant that does include function parameter info and namespace info.

LLVM commits

  • The LLVM performance tips document has gained another two entries. r235825, r235826.

  • llvm-symbolizer now works on Windows. r235900.

  • SelectionDAG, DAGCombiner and codegen support for masked scatter and gather has been added. r235970, r236211, r236394.

  • Debug locations have been added to all constant SelectionDAG nodes. r235989.

  • Dragonegg support has been dropped from the release script. r236077.

  • The debug info IR constructs have been renamed from MD* to DI*. Duncan suggests that if you're updating an out of tree target, it may be easiest to first get things compiling with the code from before this commit, then continue the merge. r236120.

Clang commits

  • Clang can now generate dependencies in the style accepted by the NMake and Jom build tools. r235903.

  • New AVX-512 intrinsics have been added. r235986, r236218.

  • Clang learned -Wpessimizing-move and -Wredundant-move warnings. r236075.

Other project commits

  • LLDB gained support for the SysV ABI on ARM and AArch64. r236097, r236098.

  • The LLVM test suite gained a frame_layout test. r236085.

by Alex Bradbury (noreply@blogger.com) at May 04, 2015 12:33 PM

April 27, 2015

LLVM Blog

LLVM Weekly - #69, Apr 27th 2015

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

News and articles from around the web

Ed Jones at Embecosm has written about his work to use the GCC regression suite on Clang and documented how to run the LLVM test suites on an embedded target.

GCC 5.1 has now been released. Congratulations to the GCC team. The versioning scheme is potentially confusing - 5.0 is the development version which saw a stable release as 5.1. The next minor releases will be 5.2, 5.3 etc and the next major release will be 6.1 (referred to as 6.0 during development).

On the mailing lists

  • Sanjoy Das has posted an RFC on supporting implicit null checks in LLVM. This is intended to support managed languages like Java, C#, or Go where a null check is required before using pointers.

  • Alex L interned at Apple last year, and is interning again this summer. He's posted to the list about his project, which is to develop a text-based human readable format that allows LLVM to serialize the machine-level IR. The intention is to make debug and testing easier. He welcomes any feedback or suggestions.

  • libunwind is moving to its own repository. Hopefully a git mirror will go live soon.

  • Roel Jordans gave a talk at EuroLLVM this year about his software pipelining pass. He has posted to the mailing list to give a few more details and share his source code.

  • Tom Stellard is looking to increase the number of code owners, i.e. the set of people who review patches or approve merge requests to stable branches on a certain part of the code. His plan is to start nominating new code owners based on git history whenever he gets a new stable merge request for an unowned component.

LLVM commits

  • Functions can now have metadata attachments. r235785.

  • The stack object allocation for Hexagon has been completely overhauled. r235521.

  • The vim support files have been updated. Changes include a new indentation plugin for .ll files. r235369.

  • llvm-link learned the -override option to override linkage rules. r235473.

  • There is now textual IR support for an explicit type parameter to the invoke instruction (much like for the call instruction). r235755.

Clang commits

  • Documentation has been added for SanitizerCoverage (simple code coverage using the Sanitizer tools). r235643.

  • Clang's __attribute__((aligned)) can now set alignment to a target-specific value, rather than just assuming 16 bytes on all platforms. r235397.

Other project commits

  • lld now understands --discard-locals. r235357.

  • lldb's 'operation' and 'monitor' threads on Linux have been merged in to one. r235304.

  • It's now possible to build compiler-rt for MIPS with gcc. r235299.

  • libunwind seems to have been moved into its own project. r235759.

by Alex Bradbury (noreply@blogger.com) at April 27, 2015 12:41 PM

April 21, 2015

LLVM Blog

LLVM Weekly - #68, Apr 20th 2015

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

News and articles from around the web

Last week was of course EuroLLVM. It was good to put faces to names for a number of you, or to meet people I've only communicated with over twitter. Slides and videos should be forthcoming, but in the meantime you can read the liveblog I maintained for the talks I was able to attend. A big thank you to the organisers and all those who presented.

The highest profile news for some time in the LLVM community is that Microsoft are working on an LLVM-based compiler for .NET CoreCLR. What's more, LLILC (pronounced 'lilac') is open source, and they hope to contribute their LLVM changes upstream.

The Cerberus team are trying to find an answer to the question 'What is C in practice?, and you can help by filling out their survey.

Honza Hubička has posted a fantastic overview of the improvements to link-time and inter-procedural optimisations in GCC5, featuring figures from Firefox builds. It seems like impressive improvements have been made.

Simon Cook has written a blog post about using TableGen outside of LLVM, specifically for things like parameterisable SSH configs. Crazy? Genius? Why not both?

On the mailing lists

LLVM commits

  • The dereferenceable_or_null attribute has been born. As described in the commit message, the motivation is for managed languages such as Java. r235132.

  • A new layer was added to the Orc JIT API for applying arbitrary transforms to IR. r234805.

  • Memory intrinsics can now be tail calls. r234764.

  • A handy Python script has been added for generating C programs that have a control flow graph which is a ladder graph. The intent is to use it to test whether an algorithm expected to be linear time on the CFG really is. r234917.

  • The code for lowering switches and extracting jump tables has been rewritten, and should produce better results now. r235101.

  • Call can now take an explicit type parameter. r235145.

Clang commits

  • Clang learned -Wrange-loop-analysis, which will warn when a range-based for loop makes copies of elements in the range. r234804.

  • The preserve-bc-uselistorder option is no longer true by default, but Clang will set it for -emit-llvm or -save-temps. r234920.

  • LLVM has had a lot of changes to the debug API in the last week. This commit updates Clang for them. r235112.

Other project commits

  • Reducing the amount of template use in LLD has reduced the size of AArch64TargetHandler.cpp.o to 4.1MB, down from 21MB. r234808, r234931.

  • A large patchset has landed in lldb which adds a big chunk of the work necessary for supporting lldb on ARM. r234870.

by Alex Bradbury (noreply@blogger.com) at April 21, 2015 08:52 AM

April 14, 2015

LLVM Blog

LLILC : An LLVM based compiler for dotnet CoreCLR.

The LLILC project (we pronounce it "lilac") is a new effort started at Microsoft to produce MSIL code generators based on LLVM and targeting the open source dotnet CoreCLR. We are envisioning using the LLVM infrastructure for a number of scenarios, but our first tool is a Just in Time (JIT) compiler for CoreCLR. This new project is being developed on GitHub and you can check it out here. The rest of this post outlines the rational and goals for the project as well as our experience using LLVM.

Why a new JIT for CoreCLR?

While the CoreCLR already has JIT, we saw an opportunity to provide a new code generator that has the potential to run across all the targets and platforms supported by LLVM. To enable this, as part of our project we're opening an MSIL reader that operates directly against the same common JIT interface as the production JIT (RyuJIT). This new JIT will allow any C# program written for the .NET Core class libraries to run on any platform that CoreCLR can be ported to and that LLVM will target.

There are several ongoing efforts to compile MSIL in the LLVM community, SharpLang springs to mind. Why build another one?

When we started thinking about the fastest way to get a LLVM based code generation working we looked around at the current open source projects as well as the code we had internally. While a number of the OSS projects already targeted LLVM BitCode, no one had anything that was a close match for the CoreCLR interface. Looking at our options it was simplest for us to refactor a working MSIL reader to target BitCode then teach a existing project to support the contracts and APIs the CoreCLR uses for JITing MSIL. Using a existing MSIL reader let us quickly start using a number of building-block components that we think the community can take advantage of. This fast bootstrap for C# across multiple platforms was the idea that was the genesis of this project and the compelling reason to start a new effort. We hope LLILC will provide a useful example - and reusable components - for the community and make it easier for other projects to interoperate with the CoreCLR runtime.

Why LLVM?

Basically we think LLVM is awesome. It's already got great support across many platforms and chipsets and the community is amazingly active. When we started getting involved, just trying to stay current with the developer mailing list was a revelation! The ability for LLVM to operate as both a JIT and as an AOT compiler was especially attractive. By bringing MSIL semantics to LLVM we plan to construct a number of tools that can work against CoreCLR or some sub set of its components. We also hope the community will produce tools what we haven't thought of yet.

Tool roadmap

  • CoreCLR JIT
    • Just In Time - A classic JIT. This is expected to be throughput-challenged but will be correct and usable for bringup. Also possible to use with more optimization enabled as a higher tier JIT
    • Install-time JIT - What .NET calls NGen. This will be suitable for install-time JITing (LLVM is still slow in a runtime configuration)
  • Ahead of Time compiler. A build lab compiler that produces standalone executables, using some shared components from CoreCLR. The AOT compiler will be used to improve startup time for important command line applications like the Roslyn Compiler.
The LLIC JIT will be a functionally correct and complete JIT for the CoreCLR runtime. It may not have sufficient throughput to be a first-tier jit, but is expected to produce high-quality code and so might make a very interesting second-tier or later JIT, or a good vehicle for prototyping codegen changes to feed back into RyuJIT.

What's Actually Working

Today on Windows we have the MSIL reader & LLVM JIT implemented well enough to compile a significant number of methods in the JIT bring up tests included in CoreCLR. In these tests we compile about 90% the methods and then fall back to RyuJIT for cases we can't handle yet. The testing experience is pretty decent for developers. The tests we run can be seen in the CoreCLR test repo.
We've establish builds on Linux and Mac OSX and are pulling together mscorlib, the base .NET Core library from CoreFx, and test asset dependencies to get testing off-the-ground for those platforms.
All tests run against the CoreCLR GC in conservative mode - which scans the frame for roots - rather than precise mode. We don't yet support Exception Handling.

Architecture

Philosophically LLILC is intended to provide a lean interface between CoreCLR and LLVM. Where possible we rely on preexisting technology.

For the JIT, when we are compiling on demand, we map the runtime types and MSIL into LLVM BitCode. From there compilation uses LLVM MCJIT infrastructure to produce compiled code that is output to buffers provided by CoreCLR.

Our AOT diagram is more tentative but the basic outline is that the code generator is driven using the same interface and the JIT but that there is a static type system behind it and we build up a whole program module with in LLVM and run in a LTO like mode. Required runtime components are emitted with the output objs and the platform linker then produces the target executable. There are still a number of open questions around issues like generics that need resolution but this is our first stake in the ground.

Experience with LLVM

In the few months we've been using LLVM, we've had a really good experience but with a few caveats. Getting started with translating to BitCode has been a very straightforward experience and ramp-up time for someone with compiler experience has been very quick. The MCJIT, which we started with for our JIT, was easy to configure and get code compiled and returned to the runtime. Outside of the COFF issue discussed below, we only had to make adjustments in configuration or straightforward overrides of classes, like EEMemoryManager, to enable working code. Of the caveats, the first was simple, but the other two are going to require sustained work to bring up to the level we'd like. The first issue was a problem with Windows support in the DynamicRuntime of the MCJIT infrastructure. The last two, Precise Garbage Collection, and Exception Handling, arise because of the different semantics of managed languages. Luckily for us, people in the community have already started working in these areas so we don't have to start from zero.

COFF dynamic loader support

One of the additions we made to LLVM to unblock ourselves was to implement a COFF dynamic loader. (The patch to add RuntimeDyldCoff.{h,cpp} is through review and has been committed). This was the only addition we directly had to make to LLVM to enable bring-up of the code generator. Once this is in, we see a number of bugs in the database around Windows JIT support that should be easier to close.

Precise Garbage Collection

Precise GC is central to the CoreCLR approach to memory management. Its intent is to keep the overhead of managed memory as low as possible. It is assumed by the runtime that the JIT will generate precise information about the GC ref lifetimes and provide it with the compiled code for execution. To support this we're beginning to use the StatePoint approach, with additions to convert the standard output format to the custom format expected by CoreCLR. We share some of the same concerns that Philip Reames wrote about in the initial design of StatePoints. E.g. preservation of "GCness" through the optimizer is critical, but must not block optimizer transformations. Given this concern one of our open questions is how to enable testing to find GC holes that creep in, but also enable extra checking that can be opted into if the incoming IR contains GC pointers.
There is a more detailed document included in our repo that outlines our more-specific GC plans here.

Exception Handling

The MSIL EH model is specific to the CLR as you'd expect, but it descends in part conceptually from Windows Structured Exception Handling (SEH). In particular, the implicit exception flow from memory accesses to implement null checks, and the use of filters and funclets in the handling of exceptions, mirrors SEH (here. is an outline of C# EH) Our plans at this point are to add all checks required by MSIL as explicit compare/branch/throw sequences to better match C++ EH as well as building on the SEH support currently being put into Clang. Then, once we have correctness, see if there is a reasonable way forward that improves performance.
Like GC, there's a detailed doc outlining our specific issues and plans in the repo here

Future Work

  • More platforms. Today we're running on Windows and starting to build for Linux and Mac OSX. We'd like more.
  • Complete JIT implementation
    • More MSIL opcodes supported
    • Precise GC support
    • EH support
  • Specialized memory allocators for hosted solutions. CoreCLR has been used as a hosted solution (run in process by other programs) but to support this we need a better memory allocation story. The runtime should be able to provide a memory allocator that is used for all compilation.
  • AOT - Fully flesh out the AOT story.

by Unknown (noreply@blogger.com) at April 14, 2015 02:03 PM

April 13, 2015

OpenMP Runtime Project

New code release

We are excited to announce the next release of the Intel® OpenMP* Runtime Library at openmprtl.org. This release aligns with Intel® Parallel Studio XE 2015 Composer Edition Update 4.

New Features

  • Debugger support interface added to the OSS library

Bug Fixes

by mad\tlwilmar at April 13, 2015 09:24 PM

LLVM Blog

LLVM Weekly - #67, Apr 13th 2015

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

EuroLLVM is going on today and tomorrow in London. I hope to see a number of you there. Provided there's a reasonable internet connection, I hope to be live-blogging the event on the llvmweekly.org version of this issue.

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

News and articles from around the web

A new post on the LLVM Blog deatils how to use LLVM's libFuzzer for guided fuzzing of libraries.

The Red Hat developer blog has an article about libgccjit, a new feature in GCC5, which may be of interest.

On the mailing lists

LLVM commits

  • The R600 backend gained an experimental integrated assembler. r234381.

  • The libFuzzer documentation has been extended to demonstrate how the Heartbleed vulnerability could have been found using it. r234391.

  • The preserve-use-list-order flags are now on by default. r234510.

  • LLVM gained a pass to estimate when branches in a GPU program can diverge. r234567.

  • The ARM backend learnt to recognise the Cortex-R4 processor. r234486.

Clang commits

  • Lifetime markers for named temporaries are now always inserted. r234581.

  • The quality of error messages for assignments to read-only variables has been enhanced. r234677.

  • clang-format's nested block formatting got a little better. r234304.

Other project commits

  • Support for the 'native' file format was removed from lld. r234641.

  • Remote debugging, the remote test suite, and the process to cross-compile lldb has been documented. r234317, r234395, r234489.

  • LLDB gained initial runtime support for RenderScript. r234503.

by Alex Bradbury (noreply@blogger.com) at April 13, 2015 12:25 PM

April 09, 2015

LLVM Blog

Simple guided fuzzing for libraries using LLVM's new libFuzzer


Fuzzing (or fuzz testing) is becoming increasingly popular. Fuzzing Clang and fuzzing with Clang is not new: Clang-based AddressSanitizer has been used for fuzz-testing the Chrome browser for several years and Clang itself has been extensively fuzzed using csmith and, more recently, using AFL. Now we’ve closed the loop and started to fuzz parts of LLVM (including Clang) using LLVM itself.

LibFuzzer, recently added to the LLVM tree, is a library for in-process fuzzing that uses Sanitizer Coverage instrumentation to guide test generation. With LibFuzzer one can implement a guided fuzzer for some library by writing one simple function: 
extern "C" void TestOneInput(const uint8_t *Data, size_t Size);

We have implemented two fuzzers on top of LibFuzzer: clang-format-fuzzer and clang-fuzzer. Clang-format is mostly a lexical analyzer, so giving it random bytes to format worked perfectly and discovered over 20 bugs. Clang however is more than just a lexer and giving it random bytes barely scratches the surface, so in addition to testing with random bytes we also fuzzed Clang in token-aware mode. Both modes found bugs; some of them were previously detected by AFL, some others were not: we’ve run this fuzzer with AddressSanitizer and some of the bugs are not easily discoverable without it.

Just to give you the feeling, here are some of the input samples discovered by the token-aware clang-fuzzer starting from an empty test corpus:
 static void g(){}
 signed*Qwchar_t;
 overridedouble++!=~;inline-=}y=^bitand{;*=or;goto*&&k}==n
 int XS/=~char16_t&s<=const_cast<Xchar*>(thread_local3+=char32_t

Fuzzing is not a one-off thing -- it shines when used continuously. We have set up a public build bot that runs clang-fuzzer and clang-format-fuzzer 24/7. This way, the fuzzers keep improving the test corpus and will periodically find old bugs or fresh regressions (the bot has caught at least one such regression already).

The benefit of in-process fuzzing compared to out-of-process is that you can test more inputs per second. This is also a weakness: you can not effectively limit the execution time for every input. If some of the inputs trigger superlinear behavior, it may slow down or paralyze the fuzzing. Our fuzzing bot was nearly dead after it discovered exponential parsing time in clang-format. You can workaround the problem by setting a timeout for the fuzzer, but it’s always better to fix superlinear behavior.

It would be interesting to fuzz other parts of LLVM, but a requirement for in-process fuzzing is that the library does not crash on invalid inputs. This holds for clang and clang-format, but not for, e.g., the LLVM bitcode reader.

Help is more than welcome! You can start by fixing one of the existing bugs in clang or clang-format (see PR23057, PR23052 and the results from AFL) or write your own fuzzer for some other part of LLVM or profile one of the existing fuzzers and try to make it faster by fixing performance bugs.

Of course, LibFuzzer can be used to test things outside of the LLVM project. As an example, and following Hanno Böck’s blog post on Heartbleed, we’ve applied LibFuzzer to openssl and found Heartbleed in less than a minute. Also, quite a few new bugs have been discovered in PCRE2 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), Glibc and MUSL libc (1, 2) .

Fuzz testing, especially coverage-directed and sanitizer-aided fuzz testing, should directly compliment unit testing, integration testing, and system functional testing. We encourage everyone to start actively fuzz testing their interfaces, especially those with even a small chance of being subject to attacker-controlled inputs. We hope the LLVM fuzzing library helps you start leveraging our tools to better test your code, and let us know about any truly exciting bugs they help you find!

by Kostya Serebryany (noreply@blogger.com) at April 09, 2015 09:06 PM

April 06, 2015

LLVM Blog

LLVM Weekly - #66, Apr 6th 2015

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

News and articles from around the web

color_coded, a vim plugin for syntax highlighting using libclang is now available.

Ravi, a dialect of Lua with JIT compilation via LLVM has has its first alpha release. The status of JIT compilation can be seen here.

On the mailing lists

LLVM commits

  • API migration has started for GEP constant factories. For now, nullptr can be passed for the pointee type, but you'll need to pass the type explicitly to be future-proof. r233938.

  • A proof of concept fuzzer based on DataFlowSanitizer has been added, as well as support for token-based fuzzing. r233613, r233745.

  • DebugLoc's API has been rewritten. r233573.

  • The SystemZ backend now supports transactional execution on the zEC12. r233803.

Clang commits

  • Clang gained a toolchain driver for targeting NaCl. r233594.

  • The size of various Stmt subclasses has been optimised on 64-bit targets. r233921.

  • Codegen was added for the OpenMP atomic update construct. r233513.

Other project commits

  • LLDB system initialization has been reworked. r233758.

by Alex Bradbury (noreply@blogger.com) at April 06, 2015 09:57 AM

March 30, 2015

LLVM Blog

LLVM Weekly - #65, Mar 30th 2015

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

News and articles from around the web

The Z3 theorem prover from Microsoft Research is now on Github, and more importantly now released under the MIT license. This is a true open source license allowing commercial use, unlike the previous non-commercial use only license. It's been used with LLVM in the ALIVe project.

The schedule for EuroLLVM has been published. There are still a number of early registration tickets left. If you can be in London on 13th and 14th of April then I'd highly recommend registering.

On the mailing lists

LLVM commits

  • The GlobalMerge pass will no longer run at O1 on AArch64+ARM, and instead will only be enabled at O3. r233024.

  • A float2int pass was added which, as the name suggests, attempts to demote from float to int where possible. r233062.

  • A simple Orc-based lazy JIT has been added to lli. r233182.

  • LLVM gained support for PowerPC hardware transactional memory. r233204.

  • The ARMv8.1a architecture has been added along with some of its new instructions. r233290, r233301

Clang commits

  • The on-disk hash table for modules should now have a stable representation. r233156, r233249.

  • Intrinsics have been added for PowerPC hardware transaction memory support. r233205.

  • An initial version of a clang-fuzzer has been added, making use of the LLVMFuzzer library. r233455.

Other project commits

  • libclc gained more builtin implementations. r232977, r232965, r232964.

  • lld learnt how to understand the MIPS N64 relocation record format (which is described in the commit message). r233057.

  • lld's ARM support has improved with with the addition of indirect function handling and GOT relocations. r233383, r233277.

by Alex Bradbury (noreply@blogger.com) at March 30, 2015 12:40 PM

March 23, 2015

LLVM Blog

LLVM Weekly - #64, Mar 23rd 2015

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

News and articles from around the web

Students have until Friday 27th March to get their applications in for Google Summer of Code. This gives the opportunity to get paid $5500 to work on open source over the summer, under the mentorship of someone from the community. See here for the list of mentoring organisations advertising LLVM-related projects. Please do help spread the word. I am biased, but I'd like to draw particular attention to the wide variety of lowRISC GSoC ideas, including a project to implement an LLVM pass using tagged memory to provide protection against control-flow hijacking.

GCC 5 is starting to get near to release. The first release candidate is expected in the first week of April.

On the mailing lists

LLVM commits

  • The backend for the Hexagon DSP has continued to grow over the past few weeks. Most recently, support for vector instructions has been added. r232728.

  • The LLVM developer documentation grew guidance on writing commit messages. r232334.

  • LLVM learnt to support the ARMv6k target. The commit message has a handy ascii art diagram to explain its position in the ARM family. r232468.

Clang commits

  • The size of a Release+Asserts clang binary has been reduced by ~400k by devirtualising Attr and its subclasses. r232726.

  • Work on MS ABI continues, with support for HandlerMap entries for C++ catch. r232538.

  • A new warning, -Wpartial-ability will warn when using decls that are not available on all deployment targets. r232750.

  • C++14 sized deallocation has been disabled default due to compatibility issues. r232788.

Other project commits

  • Performance of a self-hosted lld link has again been improved. It's now down to 3 seconds on the patch author's machine (vs 5 seconds before, and 8 seconds for the GNU BFD linker). r232460.

  • libcxx gained the <experimental/tuple> header which implements most of the tuple functionality specified in the library fundamentals TS. r232515.

  • LLD now supports the semantics of simple sections mappings in linker scripts and can handle symbols defined in them. r232402, r232409.

  • Mips64 lldb gained an initial assembly profiler. r232619.

by Alex Bradbury (noreply@blogger.com) at March 23, 2015 03:09 PM

March 16, 2015

OpenMP Runtime Project

New code release

We are excited to announce the next release of the Intel® OpenMP* Runtime Library at openmprtl.org. This release aligns with Intel® Parallel Studio XE 2015 Composer Edition Update 3.

New Features

  • OpenMP* 4.1: Support for a new kind of task needed for asynchronous offload
  • Improved Intel® Trace Analyzer and Collector and Intel® VTune™ Performance Tools support

Bug Fixes

by mad\tlwilmar at March 16, 2015 06:32 PM

LLVM Blog

LLVM Weekly - #63, Mar 16th 2015

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

News and articles from around the web

LLVM is taking part in Google Summer of Code as a mentoring organisation. Students can earn a $5500 stipend by working on open source projects over the summer, and applications upon today (March 16th). See here for the list of mentoring organisations advertising LLVM-related projects. Please do help spread the word. I am biased, but I'd like to draw particular attention to the wide variety of lowRISC GSoC ideas, including a project to implement an LLVM pass using tagged memory to provide protection against control-flow hijacking.

Version 0.11 of Pocl, the portable open-source OpenCL implementation has been released. Additions in this release include initial Android support and MIPS architecture support.

Version 1.11 of TCE, the TTA-based (Transport Triggered Architecture) Co-design Environment, which uses LLVM has been released. This release adds support for LLVM 3.6.

There will be a LLVM microconference at the Linux Plumbers Conference in August. There is a call for speakers.

On the mailing lists

LLVM commits

  • As DataLayout is now mandatory, LLVM APIs have been updated to use references to DataLayout. r231740.

  • Support was added for part-word atomics on PowerPC. r231843.

  • Initial work on enhancing ValueTracking to infer known bits of a value from known-true conditional expressions has landed. r231879.

  • The PowerPC READMEs have been updated to list potential future enhancements. r231946.

  • The llvm.eh.actions intrinsic has been added. r232003.

  • The documentation for llvm-cov has been updated. r232007.

  • The getting started docs now describe CMake as the preferred way to build LLVM. r232135.

  • llvm-vtabledump is now known as llvm-cxxdump. r232301.

Clang commits

  • The steady stream of OpenMP patches continues, with the addition of codegen support for the omp task directive and omp for. r231762, r232036.

  • Copy-constructor closures for MS ABI support has been added. r231952.

Other project commits

  • LLD gained support for linker script expression evaluation and parsing of the MEMORY and EXTERN commands. r231707, r231928, r232110.

  • LLDB gained a CODE_OWNERS.txt file. r231936.

by Alex Bradbury (noreply@blogger.com) at March 16, 2015 03:35 PM

March 09, 2015

LLVM Blog

LLVM Weekly - #62, Mar 9th 2015

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

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

News and articles from around the web

LLVM is taking part in Google Summer of Code as a mentoring organisation. Students can earn a $5500 stipend by working on open source projects over the summer. See here for the list of mentoring organisations advertising LLVM-related projects. Please do help spread the word, applications open on Monday the 16th of March. I am biased, but I'd like to draw particular attention to the wide variety of lowRISC GSoC ideas, including a project to use tagged memory to provide protection against control-flow hijacking.

Ravi, a programming language based on Lua 5.3 has been announced. It features JIT compilation using LLVM, though in the current development version only a fraction of the Lua bytecodes are JIT-compiled.

On the mailing lists

LLVM commits

  • An initial implementation of a loop interchange pass has landed. This will interchange loops to provide a more cache-friendly memory access. r231458.

  • A high-level support library for the new pass manager has been added. r231556.

  • The LLVM performance tips document has seen some new additions. r230995, r231352.

  • DenseMapIterators will now fail fast when compiled in debug mode. r231035.

  • LowerBitSets will now use byte arrays rather than bit sets to represent in-memory bit sets, which can be looked up with only a few instructions. r231043.

  • Another large portion of the DebugInfo changes has landed. r231082.

  • A new optimisation for AddressSanitizer has been added that reduces the amount of instrumentation needed, eliminating it when accessing stack variables that can be proven to be inbounds. r231241.

  • llvm.frameallocate has been replaced with llvm.frameescape. r231386.

Clang commits

  • When the -pedantic flag is given, clang will warn when a format string uses %p with non-void* args. r231211.

  • Work on MS ABI support continues. Throwing a C++ exception under the MS ABI is now supported. r231328.

Other project commits

  • The lld resolver has had a significant performance optimisation. The commit message indicates linking chrome.dll now takes 30 seconds down from 70 seconds. r231434.

  • The static binary size of lldb-server has been reduced due to a reduction in the number of initialised components. r230963.

by Alex Bradbury (noreply@blogger.com) at March 09, 2015 10:36 AM