arrow
Return

RIFS: Run-Time Invariant Function Specialization

delete2026-01-01
delete0
PRE
AI
S
Saba Jamilan *
S
Snehasish Kumar
H
Heiner Litz
DOI:10.1145/3771775.3786274delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Compilers apply optimizations such as function specialization and constant propagation to eliminate redundant work at compile time. However, because compilers must prove that values are constant, many profitable optimization opportunities remain unrealized. In this paper, we propose run-time invariant function specialization (RIFS), a profile-guided compiler technique that specializes functions based on runtime invariant call-site-specific argument values. RIFS introduces a novel value-profiling LLVM pass to identify runtime invariant arguments, even though they cannot be proven constant statically. A subsequent LLVM transformation pass generates specialized function variants tailored to these value profiles. To efficiently select among potentially thousands of specialization candidates, we develop a predictive cost model that estimates the performance benefit of each candidate prior to code generation. We integrate our passes seamlessly into the existing PGO-enabled LLVM toolchain. We evaluate RIFS across 11 real-world applications, demonstrating substantial improvements over state-of-the-art optimization techniques. RIFS achieves an average speedup of 6.3% and an instruction reduction of 2.5% over the LLVM -O3+PGO baseline.
Keywords:
Compiler Analysis
Function Specialization

Journal

P
PROCEEDINGS OF THE 35TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON COMPILER CONSTRUCTION, CC 2026
IF:
0
Papers:
18
Citations:
0

Organization

U
university of california santa cruz
Scholars:
8.7K
Papers: 6.8K
Citations: 32
University of California System cover
University of California System
Scholars:
37.7W
Papers: 33.8W
Citations: 6.6K
Cited Papers

Cited Papers

Operator strength reduction
err2001-09-01
err0
errOAAI
errKeith D. Cooper; L. Taylor Simpson; Christopher A. Vick
errShare
errSave
Guided just-in-time specialization
err2020-01-01
err0
PREAI
errLima,Caio; Cezar,Junio; Vieira Leobas,Guilherme; Rohou,Erven; Quintão Pereira,Fernando Magno
errShare
errSave
Compiler Optimization Correctness by Temporal Logic
err2004-09-01
err0
PREAI
errLacey,David; Jones,Neil D.; Van Wyk,Eric; Frederiksen,Carl Christian
errShare
errSave
Contextual dispatch for function specialization
err2020-11-13
err0
PREAI
errFlückiger,Olivier; Chari,Guido; Yee,Ming-Ho; Ječmen,Jan; Hain,Jakob; Vitek,Jan
errShare
errSave
err
IF0
err
err0
PREAI
err
errShare
errSave
errShare
errSave
Rodinia: A benchmark suite for heterogeneous computing
err2009-10-01
err0
errOAAI
errShuai Che; Michael Boyer; Jiayuan Meng; David Tarjan; Jeremy W. Sheaffer; Sang-Ha Lee; Kevin Skadron
errShare
errSave
researcher View more