Skip to content
Preprint

Portable models as a replacement for industrial heuristics in compiler optimizations

Jul 2026 · 0 citations · 15 references
Computer Science

TL;DR

The paper investigates the possibility of predicting function-inlining decisions in compact compilers, source-to-source tools, and interpreters where the reuse of GCC or LLVM optimization infrastructure is impractical and proposes a portable inlining-prediction framework that can be emitted as ordinary C code without a compiler-runtime dependency.

Abstract

The paper investigates the possibility of predicting function-inlining decisions in compact compilers, source-to-source tools, and interpreters where the reuse of GCC or LLVM optimization infrastructure is impractical. The relevance of this work is determined by the need to transfer mature inlining heuristics to systems with limited compiler infrastructure, restricted runtime dependencies, and reduced access to target-specific analysis. Existing production compilers already contain strong inliners, but their decisions depend on internal intermediate representations (IRs), pass ordering, target models, and analysis stacks that are difficult to reproduce in lightweight systems. To overcome these constraints, we propose a portable inlining-prediction framework. Production compiler diagnostics serve as supervision; a separate extractor reconstructs caller-callee callsites, prepares sterile source snippets, normalizes them into a universal AST, optionally lowers them to a lightweight structural IR, and exports scalar features for model training. Thus, a trained predictor can be emitted as ordinary C code without a compiler-runtime dependency. To evaluate the proposed framework, we constructed a dataset comprising 336,938 callsites from fifteen open-source C projects, including 79,287 compiler-reported inline events. A comparison of several tabular models is performed using project-aware validation. Under leave-one-project-out validation, CatBoost reaches ROC-AUC 0.928 and PR-AUC 0.713; after threshold tuning, F1 improves from 0.670 to 0.729 and the false-positive rate drops from 0.192 to 0.084. Feature analysis shows that most signal is concentrated in source locality, explicit inline intent, callee size, side effects, branch and call structure, signature shape, and callsite argument shape.

View source

Similar papers

Preprint Jul 2026

Compiler-Grounded Hierarchical Diagnosis for LLM-Based Triton Kernel Optimization

Recent advances in large language models (LLMs) have enabled automated kernel generation and optimization, but most existing approaches rely on surface signals such as compilation feedback and profiling metrics. These signals reveal that a kernel is slow, but not why the backend compiler fails to realize a profitable optimization, especially on emerging accelerators such as NPUs. We therefore formulate kernel optimization as a progressive cross-layer diagnosis problem that links runtime symptoms to IR structure and compiler behavior before rewriting source. Based on this insight, we present our system, a compiler-grounded and hierarchical optimization framework for Triton kernels. the system escalates from lightweight pattern triage and profiling diagnosis to IR attribution and compiler-grounded analysis only when deeper evidence is needed, then proposes evidence-backed source-level rewrites. We implement the system on Triton for Ascend NPUs and evaluate it on 37 successfully converted entries from a standardized NPUKernelBench-derived Ascend 950 benchmark. Across these entries, the system attains a geometric-mean speedup of 4.35$\times$ and a median speedup of 2.73$\times$ from the initial to optimized Triton kernel; 22/37 exceed 2$\times$ and 13/37 exceed 5$\times$. The complete distribution ranges from near-baseline entries to large wins, motivating transparent reporting of the current system's scope and limitations.

Dongjie Chen, Ping Zhao, Bohua Zhan et al. · 0 citations
Preprint Jul 2026

Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code

It is shown that generative compilation reduces non-compiling outputs and improves functional correctness, relative to standard post-generation feedback, by detecting a broad range of errors close to their source and early during generation, thereby reducing errors cascades and enabling focused diagnostics.

Niels Mündler-Sasahara, Hristo Venev, Dawn Song et al. · 0 citations
Book Open access Jul 2026

Cross-Architecture Autotuning for Single-Source Heterogeneous Programming Models

The rise of heterogeneous computing systems has intensified the need for performance-portable programming models and effective autotuning methodologies. Although compiler and runtime tuning are known to significantly influence application performance, it remains unclear how such optimizations transfer across different hardware architectures, particularly within single-source models such as SYCL. This work investigates the transferability of compile-time and runtime autotuning decisions across CPUs and GPUs, focusing on AdaptiveCpp, a SYCL implementation built on LLVM. We introduce an automated framework that jointly explores compiler flags and runtime parameters using both Bayesian optimization and a tabu-search–based strategy. The tool orchestrates compilation, execution, and measurement while also providing statistical attribution via ridge regression to quantify the impact of individual tuning parameters. Through an extensive evaluation of CPUs and GPUs from multiple vendors, we demonstrate that autotuning can deliver substantial performance gains—up to 3 × on CPUs—yet the influence of specific compiler flags often diverges across different architectures. For example, flags such as -fno-builtin yield large improvements on CPUs but have negligible effect on GPUs. We also demonstrate that runtime-level choices, such as thread-placement policies, can significantly affect performance on CPUs. Our findings highlight the challenges and opportunities of autotuning in heterogeneous, single-source programming ecosystems. They also underline the importance of architecture-aware autotuning strategies and motivate further exploration of cross-device performance modeling.

Hari Abram, Nikela Papadopoulou, Jens Domke et al. · 0 citations
Preprint Aug 2026

Effect of Abstractions and Prompting Strategies on LLM-Guided High-Performance Optimizations

It is demonstrated that LLMs provided with specific optimization goals achieve better measured performance and validity rates when generating C code compared to creating computation pipelines and optimization schedules with established frameworks, suggesting that future development should explore alternative approaches for verifiable LLM-guided code optimization.

Jiří Klepl, Matyás Brabec, Martin Kruliš · 0 citations
Preprint Jul 2026

An MLIR-Based Compilation Method for Large Language Models

An MLIR (Multi-Level Intermediate Representation) based compilation method for large language models, illustrated using two dialects of operators, TopOp and TpuOp, supporting a variety of generative models including the Qwen, Llama, InternVL, and MiniCPM-V series.

Pengchao Hu, Zhibin Xin, Yifan Chen et al. · 0 citations