For full conference details, please visit the 2018 European LLVM Developers’ Meeting website.
Back To Schedule
Monday, April 16 • 4:45pm - 5:25pm
Finding Missed Optimizations in LLVM (and other compilers)

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Randomized differential testing of compilers has had great success in finding compiler crashes and silent miscompilations. In this talk I explain how I used the same approach to find missed optimizations in LLVM and other open source compilers (GCC and CompCert).

I compile C code generated by standard random program generators and use a custom binary analysis tool to compare the output programs. Depending on the optimization of interest, the tool can be configured to compare features such as the number of total instructions, multiply or divide instructions, function calls, stack accesses, and more. A standard test case reduction tool produces minimal examples once an interesting difference has been found.

I have used these tools to compare the code generated by GCC, Clang, and CompCert. I found previously unreported missing arithmetic optimizations in all three compilers, as well as individual cases of unnecessary register spilling, missed opportunities for register coalescing, dead stores, redundant computations, and missing instruction selection patterns. In this talk I will show examples of optimizations missed by LLVM in particular, both target-independent mid-end issues and ones in the ARM back-end.


Gergö Barany

Inria Paris

Monday April 16, 2018 4:45pm - 5:25pm BST
Bristol 2