GCC and LLVM underpin much of modern software infrastructure, relying on distinct Intermediate Representations (IRs) to drive optimizations and code generation. However, the semantic and structural differences between these IRs create significant barriers for cross-toolchain interaction, limiting the reuse of compiler frontends, backends, and optimization pipelines across programming languages and compilation ecosystems. Traditional rule-based translators have attempted to bridge this gap, but their complexity and maintenance cost have hindered practical adoption. In this context, Large Language Models (LLMs) appear to be an emerging technology that offers a data-driven alternative, capable of learning complex mappings between heterogeneous compiler IRs directly from sufficiently representative examples. To explore this approach, this paper presents IRIS-14B, a 14-billion-parameter transformer model fine-tuned to translate GIMPLE (as emitted by GCC) to LLVM IR (as emitted by LLVM). The model is trained on paired IRs extracted from C sources and evaluated on the GIMPLE-to-LLVM IR transformation applied to IRs derived from real-world C code and competitive programming problems. To the best of our knowledge, IRIS-14B is the first model trained explicitly for IR-to-IR translation. It outperforms the accuracy of widely used models, including the largest state-of-the-art open models available today, ranging from 13 to 1,000 billion parameters, by up to 44 percentage points. The proposed transformation supports the integration of LLMs as complementary components within hybrid neuro-symbolic compiler architectures, where models such as IRIS-14B act as interoperability layers enabling cross-toolchain workflows without modifying existing compiler passes, while traditional compiler infrastructure continues to perform deterministic compilation and optimization.
翻译:GCC和LLVM构成了现代软件基础设施的核心,依赖不同的中间表示(IR)来驱动优化和代码生成。然而,这些IR之间的语义和结构差异给跨工具链交互带来了重大障碍,限制了编译器前端、后端和优化流水线在编程语言及编译生态中的复用。传统的基于规则的翻译器试图弥合这一鸿沟,但其复杂性和维护成本阻碍了实际应用。在此背景下,大语言模型(LLM)作为一种新兴技术出现,提供了数据驱动的替代方案,能够直接从足够代表性的示例中学习异构编译器IR之间的复杂映射。为探索这一方法,本文提出IRIS-14B——一个经微调的140亿参数Transformer模型,用于将GIMPLE(由GCC生成)翻译为LLVM IR(由LLVM生成)。该模型在从C语言源码提取的配对IR上进行训练,并针对从真实世界C代码和竞赛编程问题衍生出的IR,评估其GIMPLE到LLVM IR的翻译效果。据我们所知,IRIS-14B是首个专门为IR到IR翻译训练的模型。它比现有广泛使用的模型(包括参数规模从130亿到10000亿的当前最先进开源模型)准确率高出最多44个百分点。所提出的转换支持将LLM作为混合神经符号编译器架构中的互补组件进行集成——在此架构中,如IRIS-14B这样的模型充当互操作层,无需修改现有编译器流程即可实现跨工具链工作流,同时传统编译器基础设施继续执行确定性编译和优化。