Defeating the Optimizer: How to Write (and avoid) Unoptimizable Code

Day 2 - Systems Programming (Thu) • 16:30 • Duration: 45m

Systems languages use optimizing compilers to emit efficient code. Despite being ubiquitous, these optimizers are often treated like black boxes by programmers. It is easy to imagine optimizations that the compiler could do, but without a solid understanding programmers often make easily-fixed mistakes that prevent the optimizer from doing a good job.

This talk will go through a number of examples of these mistakes. We’ll look at code which is easily optimized by humans but cannot possibly be optimized by the most powerful compiler. We’ll discuss heuristics for estimating what the optimizer might do, methods for verifying what the optimizer actually does, and how to identify things the optimizer definitely cannot do.