LLVM Weekly - #8, Feb 24th 2014

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

I'll be at the Raspberry Jamboree at the end of the week, so if you're going as well be sure to say hi.

News and articles from around the web

On the mailing lists

Renato Golin reminds us that although work is underway to update all buildbots to support C++11, the switch to use -std=c++11 has not yet been flipped, so you'll have to hold off on using C++11 features in LLVM/Clang patches for just a little longer.

Saleem Abulrasool points to an issue running recent Clang on the Linux kernel related to the integrated assembler. As regular readers will know, the behaviour was recently changed so that for backends which have an integrated assembler, any inline assembly will be validated by it during compilation, even when compiling with -S (i.e. outputting assembly). The problem is that the Linux kernel is purposely including invalid assembly in some cases when outputting assembler files. Early responses are in favour of keeping current behaviour, people who are doing weird and wacky things can just use the -no-integrated-as switch.

In response to the earlier discussion about unwind behaviour in LLVM/Clang, Logan Chien has posted a detailed description of the problems he sees.

Kevin Qin writes asking about adding register allocation constraints. Often the mailing list threads which get highlighted in LLVM Weekly are about particularly hairy problems that don't currently have a good solution. I'm happy to see this problem has a simple solution though, as Tim Northover and Quentin Colombet point out the @earlyclobber constraint can be used to ensure the output register allocated is different to the input registers.

While working on changes to CodeGenPrepare, Quentin Combet noted his patch would introduce a dependency from libLLVMScalarOpts (where CodeGenPrepare currently lives) to libLLVMCodeGen. He writes to the list asking for views on how to solve this problem. The forming consensus seems to be that it should just be moved to CodeGen. Potentially, any IR pass that depends directly on TargetLowering should be moved also. The move to CodeGenPrepare to lib/CodeGen has now been committed.

Per Viberg is soliciting comments on his design draft for improving the detection of uninitialized arguments.

LLVM commits

The llvm-profdata tool was introduced. This tool will merge profile data generated by PGO instrumentation in Clang, though may later pick up more functionality. r201535.

In a long overdue cleanup, various member variables were renamed from TD to DL to match the renaming of TargetData to DataLayout. r201581, r201827, r201833. Additionally, DebugLoc variables which were named DL have now been renamed to DbgLoc so as not to be confused with DataLayout. r201606.

MCAsmParser now supports required parameters in macros, increasing GNU assembler compatibility. r201630.

A new TargetLowering hook, isVectorShiftByScalarCheap was added to indicate whether it's significantly cheaper to shift a vector by a scalar rather than by another vector with different values for different lanes. This is used by the new OptimizeShuffleVectorInst in CodeGenPrepare which tries to sink shufflevector instructions down to the basic block they're used so CodeGen can determine if the right hand of a shift is really a scalar. r201655.

Private linkage is now properly supported for MachO. r201700.

getNameWithPrefix and getSymbol were moved from TargetLowering to TargetMachine, which removes the dependency from Target to CodeGen. r201711.

Clang commits

The PGO instrumentation will now compute counts in a separate AST traversal. The reasons for and advantages of this change are documented in detail in the commit message. r201528.

Some initial work was committed on documenting available attributes in Clang. Attribute authors are encouraged to submit missing documentation (the method of documentation is described in the addition to the InternalManual.rst). r201515.

The IdenticalExprChecker has been extended to check the two branches of an if as well as logical and bitwise expressions. For those not familiar, this checker tries to warn about the unintended use of identical expressions. r201701, r201702.

CGRecordLayoutBuilder has been completely rewritten to remove cruft, simplify the implementation, and to work in one pass. r201907.

The CastSizeChecker was taught how to correctly deal with flexible array members. r201583.

A number of thread-safety attributes have been renamed (with their old name silently deprecated). e.g. lockable is now capability , exclusive_locks_required is now requires_capability . r201585. Additionally, the documentation was updated and greatly expanded. r201598.

Initial virtual file system support discussed previously on the mailing list has landed. r201618, r201635.

The vcvtX intrinsics were added for v8 ARM as opposed to only being recognised when targeting AArch64. r201661.

The hard-float ARM EABI (often known as gnueabihf) is now supported for FreeBSD. r201662.

Clang will now provide max_align_t in C11 and C++11 modes. Note the complaint in the commit message though that max_align_t as defined is not 'good' or 'useful'. r201729.

Again, there were a number of commits related to increasing compatibility with the MS ABI. None of them immediately leaped out at me as worth highlighting individually, so I recommend you have a flick through last weeks commits if you're particularly interested.

Other project commits