Loops are usually the performance-critical parts of a program and large codebases can contain thousands of them. In this talk, I will present my intern project at Apple: a tool to automate loop extraction and analysis at scale. In addition to presenting summary information about a program’s loops, it also presents reasons for successful and failed optimizations, with a focus on vectorization. The tool also uses Clang’s PGO functionality to sort loops by hotness so that analysis efforts can be best spent on impactful loops. This static analysis tool is easy to plug into existing build systems and helps programmers find new opportunities for performance improvements.
This tool will be open source.