acceptodds
Under review as a conference paper at ICLR 2027

PROFILE2PATCH: COMPILER-FEEDBACK-GUIDED LLM SOURCE CODE OPTIMISATION BEYOND PGO

Abstract

Profile-guided optimisation (PGO) improves programs by exploiting observed execution behaviour through compiler-controlled decisions such as branching weighting, inlining and code layout, but it cannot generally invent semantic source-level restructuring. Large language models (LLMs) can propose such transformations, yet without execution evidence they may target non-critical code or select transformations whose performance impact is unclear. Our key observation is that compiler and runtime profiles can serve not only as inputs to compiler optimization, but also as actionable evidence for guiding LLMs toward source-level transformations that address bottlenecks beyond PGO. Based on this observation, we propose Profile2Patch, a framework that localizes runtime hotspots, combines the relevant source context with progressively richer profiling evidence, and uses an LLM to generate targeted source transformation. Candidate transformations are subjected to correctness validation before performance evaluation, and the accepted implementations are compared against both the original -O3 code and PGO. We evaluate our approach on 48 benchmark across eight application groups, including GROMACS, LAMMPS, FFmpeg, SQLite, cBench, KGraph, Quant, and GEMM, using GCC 16.1 and Clang 22.1. Across the application groups, the best Profile2Patch configurations consistently outperform PGO, with speedups over the original implementation reaching 19.74× for GEMM, 5.30×, 5.85× for SQLite, and 1.88×, 2.46× for KGraph under GCC and Clang, respectively. The largest improvements occur where profiling exposes concentrated source-level bottlenecks amenable to structural transformation, whereas already highly optimised or diffuse workloads such as GROMACS provide comparatively limited optimization.

open until 14 Dec 2026

est. 32% chance this paper gets accepted at ICLR 2027.

Reject 68%Accept 32%

What do you think this paper will get?

All positions stay anonymous.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.