Planet Clang

April 27, 2016

LLVM Blog

LLVM Foundation 2016 Announcements

With 2016 upon us, the LLVM Foundation would like to announce our plans for the year. If you are not familiar with the LLVM Foundation, we are a 501(c)(3) nonprofit that supports the LLVM Project and its community. We are best known for our LLVM Developers’ Meetings, but we are introducing several new programs this year. 

The LLVM Foundation originally grew out of the need to have a legal entity to plan and support the annual LLVM Developers’ Meeting and LLVM infrastructure. However, as the Foundation was created we saw a need for help in other areas related to the LLVM project, compilers, and tools. The LLVM Foundation has established 3 main programs: Educational Outreach, Grants & Scholarships, and Women in Compilers & Tools.

Educational Outreach 

The LLVM Foundation plans to expand its educational materials and events related to the LLVM Project and compiler technology and tools. 

First, the LLVM Foundation is excited to announce the 2016 Bay Area LLVM Developers’ Meeting will be held November 3-4 in San Jose, CA. This year will be the 10th anniversary of the developer meeting which brings together developers of LLVM, Clang, and related projects. For this year’s meeting, we are increasing our registration cap to 400 in order to allow more community members to attend.

We also are investigating how we can support or be involved in other conferences in the field of compilers and tools. This may include things such as LLVM workshops or tutorials by sponsoring presenters, or providing instructional materials. We plan to work with other conference organizers to determine how the LLVM Foundation can be helpful and develop a plan going forward.

However, we want to do more for the community and have brainstormed some ideas for the coming year. We plan to create some instructional videos for those just beginning with LLVM. These will be short 5-10 minute videos that introduce developers to the project and get them started. Documentation is always important, but we find that many are turning to videos as a way to learn. 


Grants & Scholarships

We are creating a grants and scholarships program to cover student presenter travel expenses to the LLVM Developers’ Meetings. However, we also hope to expand this program to include student presenter travel to other conferences where the student is presenting their LLVM related work. Details on this program will be published once they have been finalized. 

Women in Compilers & Tools

Grace Hopper invented the first compiler and yet women are severely underrepresented in the field of compilers and tools. At the 2015 Bay Area LLVM Developers’ Meeting, we held a BoF on this topic and brainstormed ideas about what can be done. One idea was to increase LLVM awareness at technical conferences that have strong female participation. One such conference is the Grace Hopper Conference (GHC). The LLVM Foundation has submitted a proposal to present about LLVM and how to get involved with the LLVM open source community. We hope our submission is accepted, but if not, we are exploring other ways we can increase our visibility at GHC. Many of the other ideas from this BoF are being considered and actionable plans are in progress.

In addition, to these 3 programs, we will continue to support the LLVM Project’s infrastructure. The llvm.org server will move to a new machine to increase performance and reliability.  


We hope that you are excited about the work the LLVM Foundation will be doing in 2016. Our 2016 Plans & Budget may be viewed here. You may also contact our COO & President, Tanya Lattner (tanyalattner@llvm.org) or the LLVM Foundation Board of Directors (board@llvm.org).

by Tanya Lattner (noreply@blogger.com) at April 27, 2016 03:48 PM

April 25, 2016

LLVM Blog

LLVM Weekly - #121, Apr 25th 2016

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

Congratulations to the eight students who have been selected for LLVM projects on Google Summer of Code this year. There's about a month before they start coding. The time between now and then is the 'community bonding period', so please do make them feel welcome.

The preliminary release schedule for LLVM/Clang 3.8.1 has been published. This would have a deadline of May 25th for requesting changes to be merged and would see the final release on June 15th.

On the mailing lists

LLVM commits

  • An implementation of optimisation bisection support has landed. This helps to track down bugs by allowing optimisations to be selectively disabled at compile-time to identify the one introducing a miscompile. r267022.

  • The AArch64 and ARM thread pointer intrinsics have been merged to make a target-independent llvm.thread.pointer intrinsic. r266818.

  • The llvm.load.relative intrinsic has been added. r267233.

  • There have been more changes to DebugInfo which will require a bitcode upgrade. A script to perform this upgrade is linked in the commit message. r27296.

  • The ORC JIT API improved its support for RPC, including support for calling functions with return values. r266581.

  • The patchable-function function attribution has been introduced, indicating that the function should be easily patchable at runtime. r266715.

  • The IntrReadArgMem intrinsic property has been split in to IntrReadMem and IntrArgMemOnly. r267021.

  • The MachineCombiner gained the ability to combine AArch64 fmul and fadd in to an fmadd. r267328.

  • Scheduling itineraries were added for Sparc, specifically for the LEON processors. r267121.

Clang commits

  • A prototype of an include fixing tool was created. The indexer remains to be written. r266870.

  • A new warning has been added, which will trigger if the compiler tries to make an implicit instantiation of a template but cannot find the template definition. r266719.

  • Initial driver flags for EfficiencySanitizer were added. r267059.

Other project commits

  • The initial EfficiencySanitizer base runtime library was added to compiler-rt. It doesn't do much of anything yet. r267060.

  • LLD learned to support the linkerscript ALIGN command. r267145.

  • LLDB can now parse EABI attributes for an ELF input. r267291.

by Alex Bradbury (noreply@blogger.com) at April 25, 2016 11:20 AM

April 18, 2016

LLVM Blog

LLVM Weekly - #120, Apr 18th 2016

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

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

News and articles from around the web

This week has seen not one, but two articles about LLVM and profile-guided optimisation. Dig in John Engelen's article about optimising D's virtual function calls with PGO, then read Geoffroy Couprie's article about PGO with Rust.

The next Cambridge (UK) social will be at 7.30pm on April 20th, at the Cambridge Blue.

Alex Denisov has written a blog post around the idea of building a mutation testing system using LLVM.

On the mailing lists

LLVM commits

  • AtomicExpandPass learned to lower various atomic operations to __atomic_* library calls. The eventual aim is to move all atomic lowering from Clang to LLVM. r266115.

  • Targets can now define an inlining threshold multiplier, to e.g. increase the likelihood of inlining on platforms where calls are very expensive. r266405.

  • The ownership between DICompileUnit and DISubprogram has been reversed. This may break tests for your out-of-tree backend, but the commit has a link to a Python script to update your testcases. r266446.

  • llvm-readobj learned to print a histogram of an input ELF file's .gnu.hash . r265967.

  • More target-specific support for the Swift calling convention (on ARM, AARch64, and X86) has landed. Also, a callee save register is used for the swiftself parameter. r265997, r266251.

  • A new allocsize attribute has been introduced. This indicates the given function is an allocation function. r266032.

  • analyzeSiblingValues has been replaced with a new lower-complexity implementation in order to reduce compile times. r266162.

  • The AMDGPU backend gained a skeleton GlobalISel implementation. r266356.

  • Every use of getGlobalContext other than the C API has been removed. r266379.

Clang commits

  • Clang gained support for the GCC ifunc attribute. r265917.

  • The __unaligned type qualifier was implemented for MSVC compatibility. r266415.

  • Support for C++ core guideline Type.6: always initialize a member variable was completed in clang-tidy. r266191.

  • A new clang-tidy checker for suspicious sizeof expressions was added. r266451.

Other project commits

  • The way relocations are applied in the new ELF linker has been reworked. r266158.

  • ELF LLD now supports parallel codegen for LTO using splitCodeGen. r266484.

  • Support for Linux on SystemZ in LLDB landed. r266308.

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

April 11, 2016

LLVM Blog

LLVM Weekly - #119, Apr 11th 2016

Welcome to the one hundred and nineteenth 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 the slides from the recent EuroLLVM 2016 Developers' Meeting made it online. This week this has been followed by videos of the talks from the conference.

John Regehr has written about efficient integer overflow checking in LLVM, looking at cases where LLVM can and cannot remove unnecessary overflow checks, and how this might be improved.

Version 0.13 of Pocl, the portable OpenCL implementation has been released. This release works with LLVM/Clang 3.8 and 3.7, and adds initial OpenCL 2.0 support and improved HSA support.

Serge Guelton at QuarksLab has written up a really useful guide to implementing a custom directive handler in Clang.

Microsoft's Visual C++ team are looking for feedback on Clang/C2 (Clang with Microsoft CodeGen).

On the mailing lists

  • James Molloy has posted an RFC on adding support for constant folding calls to math.h functions on long doubles. Currently these functions aren't constant-folded as the internal APFloat class doesn't implement them and long double operations aren't portable. Solutions include adding support to APFloat, linking against libMPFR to provide compile-time evaluation, or recognising when the long double format of the host and target are the same, so the host math library can be called. From the responses so far, there seems to be some push-back on adding the libMPFR dependency.

  • Sanjoy Das has an RFC on adding a patchable-prologue attribute. This would be used to indicate that the function's prologue is compiled so as to provide support for easy hot-patching.

  • Ulrich Weigand has shared a patch for supporting LLDB on Linux on SystemZ. The patchset contains many big-endian fixes, and may be of interest to others looking at porting LLDB.

LLVM commits

  • The Swift calling convention as well as support for the 'swifterror' argument has been added. r265433, r265480.

  • Work on GlobalISel continues with many commits related to the assignment of virtual registers to register banks. r265445, r265440.

  • LLVM will no longer perform inter-procedural optimisation over functions that can be "de-refined". r265762.

  • The substitutions supported by lit are now documented. r265314.

  • Unrolled loops now execute the remainder in an epilogue rather than the prologue. This should produce slightly improved code. r265388.

Clang commits

  • Clang gained necessary support for the Swift calling convention. r265324.

  • New flags -fno-jump-tables and -fjump-tables can be used to disable/enable support for jump tables when lowering switch statements. r265425.

  • TargetOptions is now passed through all the TargetInfo constructors. This will allow target information to be modified based on the ABI selected. r265640.

  • A large number of intrinsics from emmintrin.h now have Doxygen docs. r265844.

Other project commits

  • clang-tidy gained a new check to flag initializers of globals that access extern objects, leading to potential order-of-initialization issues. r265774.

  • LLD's ELF linker gained new options --start-lib, --end-lib, --no-gnu-unique, --strip-debug. r265710, r265717, r265722.

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

April 04, 2016

LLVM Blog

LLVM Weekly - #118, Apr 4th 2016

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

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

News and articles from around the web

Almost all slides from the recent EuroLLVM conference are now available online for your enjoyment.

Some readers my be interested in a new paper about the 'LifeJacket' tool for verifying precise floating-point optimisations in LLVM.

Christian Neumüller has written a new tool for syntax highlighting and cross-referencing C and C++ source using libclang.

On the mailing lists

LLVM commits

  • The Lanai backend has landed. r264578.

  • A new llvm.experimental.guard intrinsic has been added. As described in the accompanying documentation, along with deoptimization operand bundles this allows frontends to express guards or checks on optimistic assumptions made during compilation. r264976.

  • Support for a number of new Altivec instructions has been added. Amazingly, this includes BCD (Binary Coded Decimal) instructions. r264568.

  • The concept of MachineFunctionProperties has been introduced, with the first property being AllVRegsAllocated. This allows passes to declare that they require a particular property, in this case requiring that they be run after regalloc. r264593.

  • On X86, push will now be used in preference to mov at all optimisation levels (before it was only enabled for -Os). r264966.

  • LLVM's support library can now compute SHA1 hashes. This is used to implement a 'build-id'. r265094, r265095.

  • When metadata is only referenced in a single function, it will now be emitted just in that function block. The aim of this is to improve the potential of lazy-loading. r265226.

Clang commits

  • The Lanai backend is now supported in the Clang driver. r264655.

  • libTooling gained a handy formatAndApplyAllReplacements function. r264745.

Other project commits

  • Parts of LLD are starting to use the new Error handling. r264910, r264921, r264924, and more.

  • Infrastructure was added to LLD for generating thunks (as required on platforms like MIPS when calling PIC code from non-PIC). r265059.

by Alex Bradbury (noreply@blogger.com) at April 04, 2016 11:22 AM

April 01, 2016

LLVM Blog

My Little LLVM: Undefined Behavior is Magic!

A horrible mashup between LLVM's old dragon logo and a My Little Pony inspired pegasus pony
New LLVM logo

There’s been lots of discussion online (and then quite some more) about compilers abusing undefined behavior. As a response the LLVM compiler infrastructure is rebranding and adopting a motto to make undefined behavior friendlier and less prone to corruption.


The re-branding puts to rest a long-standing issue with LLVM’s “dragon” logo actually being a wyvern with an upside-down head, a special form of undefined behavior in its own right. The logo is now clearly a pegasus pony.


Another great side-effect of this rebranding is increased security by auto-magically closing all vulnerabilities used by the hacker who goes by the pseudonym “Pinkie Pie”.


These new features are enabled with the -rainbow clang option, in honor of Rainbow Dash’s unary name.


A Few Examples


C++’s memory model specifies that data races are undefined behavior. It is well established that no sane compiler would optimize atomics, LLVM will therefore supplement the Standard’s happens-before relationship with an LLVM-specific happens-to-work relationship. On most architectures this will be implemented with micro-pause primitives such as x86’s rep rep rep nop instruction.


Shifts by bit-width or larger will now return a normally-distributed random number. This also obsoletes rand() and std::random_shuffle.


bool now obeys the rules of truthiness to avoid that annoying “but what if it’s not zero or one?” interview question. Further, incrementing a bool with ++ now does the right thing.


Atomic integer arithmetic is already specified to be two’s complement. Regular arithmetic will therefore now also be atomic. Except when volatile, but not when volatile atomic.


NaNs will now compare equal, subnormals are free to self-classify as normal / zero / other, negative zero simply won’t be a thing, IEEE-754 has been upgraded to PONY-754, floats will still round with style, and generating a signaling NaN is now guaranteed to not be quiet by being equivalent to putchar('\a'). While we’re at it none of math.h will set errno anymore. This has nothing to do with undefined behavior but seriously, errno?


Type-punning isn’t a thing anymore. We’re renaming it to type-pony-ing, but it doesn’t do anything surprising besides throw parties. AND WHO DOESN’T LIKE PARTIES‽ EVEN SECURITY PEOPLE DO! 🎉


A Word From Our Sponsors



The sanitizers—especially undefined behavior sanitizer, address sanitizer and thread sanitizer—are great tools when dealing with undefined behavior. Use them on your tests, combine them with fuzzers, try them as cupcake topping! Be warned: their runtimes aren’t designed to be secure and you shouldn’t ship them in production code!


Cutie Marks


To address the horse in the room: we’ve left the new LLVM logo’s cutie mark as implementation-defined. Different instances of the logo can use their own cutie mark to illustrate their proclivities, but must clearly document them.



by JF Bastien (noreply@blogger.com) at April 01, 2016 07:02 AM

March 29, 2016

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 3.

New Features

  • OpenMP* 4.5 schedule(simd:static) support

Bug Fixes

  • Hwloc topology discovery improved
  • Spin backoff mechanism fixed in lock code
  • Plain barrier performance improved on Intel(R) Xeon Phi

Contributions

by mad\tlwilmar at March 29, 2016 06:50 PM

March 28, 2016

LLVM Blog

LLVM Weekly - #117, Mar 28th 2016

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

Google Summer of Code applications are now closed. Applicants and interested third-parties can look forward to finding out which projects were selected on April 22nd.

Ramkumar Ramachandra has written a blog post giving a whirlwind tour of the internals of LLVM's fast register allocator (FastRegAlloc.cpp).

Alex Denisov has blogged about the various test suites used within the LLVM project.

Version 1.13 of the TTA-based Co-design Environment (TCE) has been released. This adds support for LLVM 3.8.

On the mailing lists

LLVM commits

  • A new utility, update_test_checks.py was added to update opt or llc test cases with new FileCheck patterns. r264357.

  • Non-power-of-2 loop unroll count pragmas are now supported. r264407.

  • The NVPTX backend gained a new address space inference pass. r263916.

  • Instances of Error are now convertible to std::error_code. Conversions are also available between Expected<T> and ErrorOr<T>. r264221, r264238.

  • Hexagon gained supported for run-time stack overflow checking. r264328.

Clang commits

  • Clang now supports lambda capture of *this by value. r263921.

  • The bitreverse builtins are now documented. r264203.

Other project commits

  • LLDB will fix inputted expressions with 'trivial' mistakes automatically. r264379.

  • ThreadSanitizer debugging support was added to LLDB. r264162.

  • Polly gained documentation to describe how it fits in to the LLVM pass pipeline. r264446.

  • LLDB has been updated to handle the UTF-16 APIs on Windows. r264074.

by Alex Bradbury (noreply@blogger.com) at March 28, 2016 01:22 PM

March 21, 2016

LLVM Blog

LLVM Weekly - #116, Mar 21st 2016

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

If you're a student and would like to get paid to work on an LLVM-related project over the summer then do consider applying for Google Summer of Code with LLVM. More details about Summer of Code are available here. The deadline for applications is this Friday, March 25th at 1900 GMT. I'd also encourage you to look at lowRISC's project ideas if you have an interest in open source hardware.

Stephen Kelly has written about his new Clang-based tool for porting a C++ codebase to use almost-always-auto. As was pointed out on Twitter, Ryan Stortz from Trail of Bits has a tools that removes auto and does roughly the opposite.

Honza Hubička has written up his experiments of building LibreOffice with GCC6 and LTO. This includes a comparison to a build using LLVM and Clang.

Nick Clifton has shared an update for February and March on the GNU toolchain that may be of interest.

The developer of the Capstone disassembly framework and the Unicorn multi-architecture simulator is running a funding campaign for the Keystone multi-architecture assembler framework. Like Capstone, this will build on LLVM but also aims to go beyond it.

On the mailing lists

LLVM commits

  • A new Error support class has been added to support structured error handling. See the associated updates to the LLVM programmer's manual for more info. r263609.

  • New documentation was committed for advanced CMake build configurations. r263834.

  • Support was added for MIPS32R6 compact branches. r263444.

  • The MemCpyOptimizer will now attempt to reorder instructions in order to create an optimisable sequence. r263503.

  • llvm-readobj learnt to print sections and relocations in the GNU style. r263561.

Clang commits

  • Attributes have been added for the preserve_mostcc and preserve_allcc calling conventions. r263647.

  • clang-format will handle some cases of automatic semicolon insertion in JavaScript. r263470.

  • Clang learned to convert some Objective-C message sends to runtime calls. r263607.

Other project commits

  • AddressSanitizer is now supported on mips/mips64 Android. r263261.

  • The documentation on the LLD linker has added a few numbers to give an idea of the sort of inputs it needs to handle. e.g. Chrome with debug info contains roughly 13M relocations, 6.3M symbols, 1.8M sections and 17k files. r263466.

by Alex Bradbury (noreply@blogger.com) at March 21, 2016 12:06 PM

March 14, 2016

LLVM Blog

LLVM Weekly - #115, Mar 14th 2016

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

We have an LLVM-related research position currently being advertised here at the University of Cambridge Computer Lab. If you'd like an informal chat about what it's like working in this group or on this project please don't hesitate to get in touch with me.

News and articles from around the web

LLVM and Clang 3.8 have now been released. Check out the LLVM and Clang release notes for a run-down of the new features.

It's GDC this week and if you're attending you may be interested that there's an LLVM meetup scheduled for Thursday.

Felix Angell has a detailed blog post introducing generating LLVM IR from Go.

On the mailing lists

LLVM commits

  • Loop invariant code motion learnt the ability the exploit the fact a memory location is known to be thread-local. r263072.

  • A new llvm.experimental.deoptimize intrinsic has been added. r26328.

  • A ThinLTOCodeGenerator was added in order to provide a proof-of-concept implementation. r262977.

  • The Sparc backend gained support for co-processor condition branching and conditional traps. r263044.

Clang commits

  • Clang gained support for the [[nodiscard]] attribute. r262872.

  • New AST matchers were added for addrLabelExpr, atomicExpr, binaryCondtionalOperator, designatedINitExpr, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueINitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr. r263027.

Other project commits

  • Error and warning messages in LLD are now more consistent. r263125.

  • Documentation on the new ELF and COFF LLD linkers has been updated. r263336.

by Alex Bradbury (noreply@blogger.com) at March 14, 2016 11:56 AM

March 07, 2016

LLVM Blog

LLVM Weekly - #114, Mar 7th 2016

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

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

News and articles from around the web

LLVM has been accepted as a mentoring organisation in Google Summer of Code 2016. See here for more about what that means. If you're a student who would like to get paid to work on LLVM over the summer, you should definitely consider applying. Also take a look at the full list of organisations in GSoC 2016. If you have an interest in open source hardware, in my (biased) opinion you should definitely look at lowRISC's listed project ideas.

LLVM and Clang 3.8 'final' has been tagged. A release should be imminent.

There was a big C++ committee meeting last week. You can find summaries here and here. If you were hoping for modules, concepts, UFCS, ranges, or coroutines in C++17 I'm afraid you're in for disappointment. Many new features will be available in C++ Technical Specifications though.

llvmlite 0.9.0 has been released. llvmlite is a light-weight Python binding for LLVM. If you're wondering how to get started with llvmlite, then check out this recent blog post from Ian Bertolacci on writing fibonacci in LLVM with llvmlite.

Andi McClure has written a really interesting blog post about writing software without a compiler. In this case, generating LLVM IR from LuaJIT.

On the mailing lists

LLVM commits

  • MemorySSA has gained an initial update API. r262362.

  • TableGen can now check at compile time that a scheduling model is complete. r262384.

  • New comments in PassBuilder give a description of what trade-offs are expected for each optimisation level. r262196.

  • LoopLoadElimination is now enabled by default. r262250.

  • A new patch adding infrastructure for profile-guided optimisation enhancements in the inline has landed. r262636.

  • Experimental ValueTracking code which tried to infer more precise known bits using implied dominating conditions has been removed. Experiments didn't find it to be profitable enough, but it may still be useful to people wanting to experiment out of tree. r262646.

Clang commits

  • Clang's C API gained an option to demote fatal errors to non-fatal errors. This is likely to be useful for clients like IDEs. r262318.

  • clang-cl gained initial support for precompiled headers. r262420.

  • An -fembed-bitcode driver option has been introduced. r262282.

  • Semantic analysis for the swiftcall calling convention has landed. r262587.

  • Clang's TargetInfo will now store an actual DataLayout instance rather than a string. r262737.

Other project commits

  • LLDB can now read line tables from Microsoft's PDB debug info files. r262528.

  • The LLVM test-suite gained the ability to hash generated binaries and to skip tests if the hash didn't change since a previous run. r262307.

  • LLVM's OpenMP runtime now supports the new OpenMP 4.5 doacross loop nest and taskloop features. r262532, r262535.

by Alex Bradbury (noreply@blogger.com) at March 07, 2016 12:40 PM

February 29, 2016

LLVM Blog

LLVM Weekly - #113, Feb 29th 2016

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

News and articles from around the web

LLVM and Clang 3.8RC3 has been tagged.

EuroLLVM 2016 is less than a month away. If you want to attend, be sure to register.

The Red Hat blog has a summary of new features in the upcoming GCC 6 release.

The Meeting C++ blog has a helpful summary of a subset of the proposals for the next C++ committee meeting.

On the mailing lists

LLVM commits

  • The Sparc backend now contains definitions for all registers and instructions defined in the Sparc v8 manual. r262133.

  • LLVM gained a basic LoopPassManager, though it currently only contains dummy passes. r261831.

  • A number of TargetInstrInfo predicates now take a reference to a MachineInstr rather than a pointer. r261605.

  • The WebAssembly backend gained redzone support for the userspace stack. r261662.

Clang commits

  • Whole-program vtable optimisation is now available in Clang using the -fwhole-program-vtables flag. r261767.

  • Clang gained __builtin_canonicalize which returns the platform-specific canonical encoding of a floating point number. r262122.

  • A hasAnyName matcher was added. r261574.

  • The pointer arithmetic checker has been improved to report fewer false positives. r261632.

Other project commits

  • The new ELF linker gained support for identical code folding (ICF). This reduces the size of an LLD binary by 3.6% and of a Clang binary by 2.7%. As described in the commit message, this is not a "safe" version of ICF as implemented in GNU gold, so will cause issues if the input relies on two distinct functions always having distinct addresses. r261912.

  • Polly's tree now contains an update_check.py script that may be useful to other LLVM devs. It updates a FileCheck-based lit test by updating the CHECK: lines with the actual output of the RUN: command. r261899.

  • LLDB gained a new set of plugins to help debug Java programs, specifically Java code JIT-ed by the Android runtime. r262015.

  • The new OpenMP 4.5 affinity API is now supported in LLVM's openmp implementation. r261915.

  • The new ELF linker gained support for the -r command-line option, which produces relocatable output (partial linking). r261838.

  • The CMake/lit runner for SPEC in the LLVM test-suite can now run the C CPU2006 floating point benchmarks (but not the Fortran ones). r261816.

  • The old ELF linker has been deleted from LLD. r262158.

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

February 25, 2016

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 2

New Features:

  • Hwloc* 2.0 support added for affinity interface
  • OMPT support for windows
  • Support for untied tasks
  • OpenMP* 4.5 doacross, taskloop, and new affinity API

Bug Fixes:

by mad\jlpeyton at February 25, 2016 10:21 PM

February 22, 2016

LLVM Blog

LLVM Weekly - #112, Feb 22nd 2016

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

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

News and articles from around the web

Filip Pizlo has written a fantastic article introducing the new B3 JIT compiler for WebKit's JavaScriptCore. This intends to replace LLVM as the optimising backend to their fourth-tier JIT. The article describes in detail their reasons for moving away from LLVM (mainly compile-time) and the design trade-offs made, such as in reducing memory allocations and minimising pointer-chasing in the IR. This reminds me of the trade-offs Mike Pall made in the LuaJIT 2.0 IR. Philip Reames also shared some initial thoughts on B3. I know some people have expressed disappointment about WebKit moving away from LLVM, but if you'll allow me to insert just a little bit of editorial I'd argue B3 is a very positive development for LLVM and the wider compiler community. B3 explores a different set of design trade-offs to those chosen for LLVM, and these sort of changes are probably easiest to explore in a fresh codebase.Thanks to this write-up (and hopefully future B3/AIR documentation), we can learn from the B3 developers' experiences and consider if some of their choices will make sense for LLVM. It's also good to remember that LLVM isn't the only feasible route for code generation and optimisation, and we shouldn't treat LLVM's design choices as the one-true way to do things. Impressively, B3 was developed to its current state in only 6 months of developer-time.

Version 0.17.0 of LDC, the LLVM-based compiler for the D programming language has been released. You can view a detailed changelog here.

GCC6 will feature a whole bunch of new warnings, and this blog post details many of them.

The schedule for EuroLLVM 2016 has now been posted. This will be held March 17th-18th in Barcelona.

On the mailing lists

LLVM commits

  • The PPCLoopDataPrefetch pass has been moved to Transforms/Scalar/LoopDataPrefetch in preparation for it becoming a target-agnostic pass. r261265.

  • The cmpxchg LLVM instruction now allows pointer type operands. r261281.

  • The X86 backend gained support for a new stack symbol ordering optimisation. This is primarily intended to reduce code size, and produces small but measurable improvements across some SPEC CPU 2000 benchmarks. r260917.

  • The LLVM C API has been extended to allow it to be used to manipulate the datalayout. r260936.

  • Some major work on the LazyCallGraph has been checked in. r261040.

  • The AMDGPU backend gained a basic disassembler. r261185.

  • The PostOrderFuctionAttrs pass has been ported to the new pass manager. As described in the commit message, this actually represents a major milestone. r261203.

  • The Hexagon backend gained support for thread-local storage. r261218.

Clang commits

  • A nullPointerConstant AST matcher was added. r261008.

  • Clang gained a -Wcomma warning, which will warn for most uses of the builtin comma operator. r261278

Other project commits

  • LLD has sprouted a release notes document. r260960.

  • The LLVM test-suite's CMake build system saw a number of fixes for SPEC. r261470.

by Alex Bradbury (noreply@blogger.com) at February 22, 2016 11:29 AM

February 16, 2016

Philip Reames

Quick thoughts on WebKit’s B3

I just finished reading Introducing the B3 JIT Compiler and wanted to jot down some thoughts.  Fair warning, this post is being written in a hurry.  I’m focusing on getting down my initial reactions rather than trying for a really well thought out post.  That may follow at a later time or it may not.

The first key bit is that the goal of this effort appears to be strictly compile time, not peak performance.  Understanding that makes the effort make a lot more sense.  It’s still seems a bit odd to me for the compile time of your *fourth tier* JIT to be that important, but given I’m no expert in JavaScript, I’ll just accept that as a given.

In that context, I find the claimed 4.7x reduction in compile time surprisingly unexciting.  There’s enough low hanging fruit in LLVM – in particular, a better representation for “check” nodes – that I would expect something on that magnitude being possible within the existing framework they had.  Achieving a ~5 improvement of compile time with an entirely new compiler (and all of the engineering that implies), seems slightly disappointing.  Now it’s possible (heck, even likely!) that the new architecture will allow them to further drop compile time, but still…

The performance numbers quoted were uninformative at best.  From what I can gather in the write up, the JetStream benchmark is highly influenced by compile time.  While I understand the goal (it’s a useful one), it doesn’t really say anything about the peak performance of the code generated by the two compilers.  Given that, it’s really hard to tell if B3 is actually breakeven with the existing LLVM backend at peak. It have been really nice to see the same numbers with the compile time somehow removed or adjusted for.  (b3 with a sleep to be slower?  A longer warmup period in a modified benchmark?)

Just to be clear, I’m not saying that the numbers presented are “wrong”.  Merely that they don’t answer the question I’d most like them to. :)

Other things that jumped out at me:

  • The points about matching the IR to the source language in an effort to reduce the number of nodes (and thus memory, and time) are spot on.  If what you’re going for is compile time above all else, using an IR which closely matches your source language is absolutely the right approach.  This same general idea (remove memory/nodes where they don’t provide enough value) is what’s motivating the removal of pointer-to-pointer bitcasts in LLVM right now.
  • The emphasis on the importance of the “check” node (i.e. early OSR exit if condition fails) matches our experience as well.  You can also see this in Swift’s IR as well.  There is clearly an area that LLVM needs to improve.  I think we can do a lot better within LLVM, and I’m surprised they didn’t try to push that.  In particular, the aliasing problems mentioned could have been addressed with a custom AliasAnalysis instance.  Oh well.
  • The choice to use arrays (instead of lists) gives some interesting tradeoffs.  From a compile time perspective, a modify and compact scheme is likely a win.  Interestingly, this reminds me a lot of a mark-compact garbage collector (b3’s layout) vs a standard malloc/free allocator (llvm’s layout).  Given typical lifetimes in a compiler (short!), the collector approach is likely to be the right one.  It does raise some interesting challenges though: pointer equality can no longer be used, trivial dead code elimination is no longer trivial (which complicates various other transforms), and transforms have to deal with non-canonical forms due to extra identify nodes.  It’ll be really interesting to see where b3 goes on this basis alone.

by reames at February 16, 2016 12:22 AM

February 15, 2016

LLVM Blog

LLVM Weekly - #111, Feb 15th 2016

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

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

News and articles from around the web

There has been a new release of the CilkPlus compiler. This includes an update to the latest LLVM and Clang trunk. CilkPlus implements the Cilk Plus language extensions for data and task parallelism in Clang.

There's been some more papers appearing from the C++ standards committee. P0225R0, or as you may prefer to call it "Why I want Concepts, and why I want them sooner rather than later" is worth a read. There's also been a few other recently published papers on iterator facades, the filesystem technical specification, and unified function call syntax.

On the mailing lists

LLVM commits

  • The WholeProgramDevirt pass has been added. This implements whole program optimization of virtual calls where the list of callees is known to be fixed. r260312.

  • The AVR backend upstreaming continues with the addition of the AVR tablegen instruction definitions. r260363.

  • There's been a bunch of other work on the new global instruction selection mechanism this week, but the commits I'd pick out are the addition of support for translating Add instructions and for lowering returns. It is currently being tests with the AArch64 backend. r260549, r260562, r260600.

  • The AArch64 backend gained support (including a scheduling model) for the Qualcomm Kryo CPU. r260686.

  • LoopUnrollAnalyzer has been abstracted out from LoopUnrollPass, and gained unit tests for its functionality. r260169.

  • llvm-config gained preliminary Windows support. r260263.

  • The details of the convergent attribute have been clarified in the language reference. The convergent attribute will now be removed on functions which provably don't converge or invoke any convergent functions. r260316, r260319.

Clang commits

  • It is now possible to perform a 3-stage Clang build using CMake. It is suggested in the commit message this may be useful for detecting non-determinism in the compiler by verifying stage2 and stage3 are identical. r260261.

  • ARMv8.2-A can be targeted using appropriate Clang options. r260533.

  • Clang's CMake build system learned the CLANG_DEFAULT_CXX_STDLIB to set the default C++ standard library. r260662.

Other project commits

  • The new LLD ELF linker gained initial link-time optimisation support. r260726.

  • LLDB has seen some more updates for Python 3 support, though not yet enough for a clean testsuite run. r260721.

by Alex Bradbury (noreply@blogger.com) at February 15, 2016 11:58 AM

February 08, 2016

LLVM Blog

LLVM Weekly - #110, Feb 8th 2016

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

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

News and articles from around the web

Slides from the LLVM devroom at FOSDEM last weekend are now available online. Unfortunately there was an issue with the recording of the talks so videos will not be available.

JavaScriptCore's FTL JIT is moving away from using LLVM as its backend, towards B3 (Bare Bones Backend). This includes its own SSA IR, optimisations, and instruction selection backend.

Source tarballs and binaries are now available for LLVM and Clang 3.8-RC2.

The Zurich LLVM Social is coming up this Thursday, February 11th at 7pm.

Jeremy Bennett has written up a comparison of the Clang and GCC command-line flags. The headline summary is that 397 work in both GCC and LLVM, 433 are LLVM-only and 598 are GCC-only.

vim-llvmcov has been released. It is a vim plugin to show code coverage using the llvm-cov tool.

On the mailing lists

  • Mehdi Amini has posted an RFC on floating point environment and rounding mode handling in LLVM. The work started all the way back in 2014 and has a whole bunch of patches up for review. Chandler Carruth has responded with a detail description of his concerns about the current design, and his proposed alternative seems to be getting a lot of positive feedback.

  • Morten Brodersen has recently upgraded a number of applications from the old JIT to the new MCJIT under LLVM 3.7.1 but has found significant performance regressions. Some other respondents have seen similar issues, either in compilation time or in reduced code quality in the generated code. Some of the thread participants will be providing specific examples so they can be investigated. It's possible the issue is something as simple as a different default somewhere. Benoit Belley noted they saw regressions due to their frontend's use of allocas in 3.7.

  • Lang Hames kicked off a long discussion about error handling in LLVM libraries. Lang has implemented a new scheme and is seeking feedback on it. There's a lot of discussion that unfortunately I haven't had time to summarise properly. If error handling design interests you, do get stuck in.

  • Adrian McCarthy has written up details on the recent addition of minidump support to LLDB. Minidumps are the Windows equivalent of a core file.

  • Juan Wajnerman is looking at adding support for multithreading to the Crystal language, and has a question about thread local variables. LLVM won't re-load the thread local address, which causes issues when a thread local variable is read in a coroutine running on one thread which is then suspended and continued on a different thread. This is apparently a known issue, covered by PR19177.

  • Steven Wu has posted an RFC on embedding bitcode in object files. The intent is to upstream support that already exists in Apple's fork. Understandably some of the respondents asked how this relates to the .llvmbc section that the Thin-LTO work is introducing. Steven indicates it's pretty much the same, but for Mach-O rather than ELF and that he hopes to unify them during the upstreaming.

LLVM commits

  • LLVM now has a memory SSA form. This isn't yet used by anything in-tree, but should form a very useful basis for a variety of analyses and transformations. This patch has been baking for a long time, first being submitted for initial feedback in April last year. r259595.

  • A new loop versioning loop-invariant code motion (LICM) pass was introduced. This enables more opportunities for LICM by creating a new version of the loop guarded by runtime checks to test for potential aliases that can't be determined not to exist at compile-time. r259986.

  • LazyValueInfo gained an intersect operation on lattice values, which can be used to exploit multiple sources of facts at once. The intent is to make greater use of it, but already it is able to remove a half range-check when performing jump-threading. r259461.

  • The SmallSet and SmallPtrSet templates will now error out if created with a size greater than 32. r259419.

  • The ability to emit errors from the backend for unsupported features has been refactored, so BPF, WebAssembly, and AMDGPU backends can all share the same implementation. r259498.

  • A simple pass using LoopVersioning has been added, primarily for testing. The new pass will fully disambiguate all may-aliasing memory accesses no matter how many runtime checks are required. r259610.

  • The way bitsets are used to encode type information has now been documented. r259619.

  • You can now use the flag -DLLVM_ENABLE_LTO with CMake to build LLVM with link-time optimisation. r259766.

  • TableGen's AsmOperandClass gained the IsOptional field. Setting this to 1 means the operand is optional and the AsmParser will not emit an error if the operand isn't present. r259913.

  • There is now a scheduling model for the Exynos-M1. r259958.

Clang commits

  • Clang now has builtins for the bitreverse intrinsic. r259671.

  • The option names for profile-guided optimisations with the cc1 driver have been modified. r259811.

Other project commits

  • AddressSanitizer now supports iOS. r259451.

  • The current policy for using the new ELF LLD as a library has been documented. r259606.

  • Polly's new Sphinx documentation gained a guide on using Polly with Clang. r259767.

by Alex Bradbury (noreply@blogger.com) at February 08, 2016 04:44 PM

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 08, 2016 04:43 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