Preprint
Large Language Models

LLM Compiler

July 1, 2024

0

Citations

0

Influential Citations

Venue

2024

Year

Abstract

A suite of pre-trained models designed for code optimization tasks, built upon Code Llama, with two sizes (7B and 13B), trained on LLVM-IR and assembly code to optimize compiler intermediate representations, assemble/disassemble, and achieve high accuracy in optimizing code size and disassembling from x86_64 and ARM assembly back into LLVM-IR.

Analysis

Why This Paper Matters

This paper introduces LLM Compiler, a suite of pre-trained models that apply large language models to compiler intermediate representation (IR) optimization. By leveraging Code Llama and training on LLVM-IR and assembly code, the models can optimize code size and perform assembly/disassembly tasks. This is significant because compiler optimization is a critical but traditionally hand-crafted process; automating it with LLMs could reduce development time and improve code efficiency. The focus on LLVM-IR, a widely used compiler infrastructure, makes the work broadly applicable.

Technical Contributions

  • Pre-trained models for IR optimization: Two model sizes (7B and 13B) are trained specifically for compiler tasks, extending Code Llama's capabilities.
  • Assembly/disassembly: The models can translate between LLVM-IR and x86_64/ARM assembly, enabling bidirectional code transformation.
  • Code size optimization: The models achieve high accuracy in reducing code size, a key metric in embedded and performance-critical systems.

Results

The abstract reports high accuracy in optimizing code size and disassembling from x86_64 and ARM assembly back into LLVM-IR. However, no specific numerical metrics or comparisons to baseline methods are provided. The results suggest the models are effective for these tasks, but further details would be needed for rigorous evaluation.

Significance

LLM Compiler represents a step toward using LLMs for low-level code optimization, a domain traditionally dominated by rule-based heuristics. If successful, it could automate parts of the compiler optimization pipeline, reduce manual effort, and enable more efficient code generation. This work also highlights the versatility of LLMs beyond natural language, extending to structured code and intermediate representations.