PhD Seminar • Software Engineering • Discovering Missed Peephole Optimizations with Large Language

Wednesday, March 11, 2026 10:30 am - 11:30 am EDT (GMT -04:00)

Please note: This PhD seminar will take place online.

Hongxu Xu, PhD candidate
David R. Cheriton School of Computer Science

Supervisor: Professor Chengnian Sun

Peephole optimization replaces inefficient instruction sequences to improve code size and performance. Despite its importance in the optimization pipeline, discovering effective new peepholes is challenging. Prior approaches are limited by poor scalability or restrictive search spaces within complex instruction sets.

This paper introduces LPO, an automated framework to discover missed peephole optimizations. By synergistically combining the strengths of LLMs and formal verifiers in a closed-loop feedback mechanism, LPO can effectively discover verified peephole optimizations that were previously missed. Our evaluation shows that LPO can successfully identify up to 22 out of 25 previously reported missed optimizations in LLVM. In contrast, the recently proposed superoptimizers for LLVM, Souper and Minotaur detected 15 and 3 of them, respectively. More importantly, within eleven months of development and intermittent testing, LPO found 62 missed peephole optimizations, of which 28 were confirmed and an additional 13 had already been fixed in LLVM. These results demonstrate LPO’s strong potential to continuously uncover new optimizations as LLMs’ reasoning improves.


Attend this PhD seminar virtually on Zoom.