Pith. sign in

REVIEW 2 cited by

Finding Missed Code Size Optimizations in Compilers using LLMs

Not yet reviewed by Pith; the record is open.

This paper has not been read by Pith yet. Machine review is queued; the pith claim, tier, and objections will appear here once it completes.

SPECIMEN: schema-true, not a live event

T0 review · schema-true

One-sentence machine reading of the paper's core claim.

pith:XXXXXXXX · record.json · timestamp

arxiv 2501.00655 v1 pith:UK7AQXWK submitted 2024-12-31 cs.SE cs.LGcs.PL

Finding Missed Code Size Optimizations in Compilers using LLMs

classification cs.SE cs.LGcs.PL
keywords compilerscodetestingapproachbugscompilerbeendifferential
verification ladder T0 review T1 audit T2 compute T3 formal T4 reserved
0 comments
read the original abstract

Compilers are complex, and significant effort has been expended on testing them. Techniques such as random program generation and differential testing have proved highly effective and have uncovered thousands of bugs in production compilers. The majority of effort has been expended on validating that a compiler produces correct code for a given input, while less attention has been paid to ensuring that the compiler produces performant code. In this work we adapt differential testing to the task of identifying missed optimization opportunities in compilers. We develop a novel testing approach which combines large language models (LLMs) with a series of differential testing strategies and use them to find missing code size optimizations in C / C++ compilers. The advantage of our approach is its simplicity. We offload the complex task of generating random code to an off-the-shelf LLM, and use heuristics and analyses to identify anomalous compiler behavior. Our approach requires fewer than 150 lines of code to implement. This simplicity makes it extensible. By simply changing the target compiler and initial LLM prompt we port the approach from C / C++ to Rust and Swift, finding bugs in both. To date we have reported 24 confirmed bugs in production compilers, and conclude that LLM-assisted testing is a promising avenue for detecting optimization bugs in real world compilers.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 2 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. Can Coding Agents Implement Missed Compiler Optimizations? Evaluating LLM Agents on LLVM Peephole Optimizations

    cs.SE 2026-07 accept novelty 6.5

    No evaluated coding agent simultaneously matches human experts on behavioral validity and profitability when implementing real missed InstCombine optimizations from LLVM issues.

  2. GRACE: Cluster-Specific Sequence Reuse for Compiler Auto-Tuning

    cs.SE 2025-10 conditional novelty 5.0

    GRACE pre-computes cluster-specific compiler-pass sequences via contrastive embeddings and evolution, cutting LLVM IR instruction count about 10% over opt -Oz in under 1 second per program.