AI agents can generate compiler optimization patches, but they typically optimize only the reported case rather than generalizing to all similar cases like human developers do—a gap that retrieval-augmented techniques can partially close.
This paper studies how well AI agents can patch compiler optimizations that were missed by LLVM. The key finding is that agents struggle to generalize patches beyond the specific reported case—they often fix the example but fail to cover all similar cases that developers would handle.