Proceedings of the ACM on Programming Languages· 2026Q1
E-grafikler Aracılığıyla Kod Boyutu Küçültme İçin Optimal Fonksiyon Yerleştirme İçin Yeni Bir Yaklaşım
A New Approach to Optimal Function Inlining for Code Size Minimization via E-graphs
- 1atıf
- Q1SCImago
- 2026yıl
Kısa özet
E-grafiklere dayanan yeni bir algoritma, kod boyutunu LLVM'ye kıyasla %4,66 oranında azaltarak, 20 kat daha hızlı çalışırken en gelişmiş otomatik ayarlama yöntemleriyle rekabetçi sonuçlar elde ediyor.
Yapay zekâ ile başlık ve abstract'tan üretildi; tam metin okunmaz.
Ana noktalar
- Kod boyutu küçültme için optimal fonksiyon yerleştirme NP-zor bir problemdir.
- E-grafikleri kullanan yeni bir algoritma, kod boyutunu LLVM'ye kıyasla %4,66 oranında azaltmaktadır.
- E-grafik yaklaşımı, en gelişmiş otomatik ayarlama yöntemlerinden 20 kat daha hızlıdır.
- E-grafikleri otomatik ayarlama ile birleştirmek, kod boyutunu LLVM çıktısının %93,94'üne kadar daha da azaltmaktadır.
Yapay zekâ ile başlık ve abstract'tan üretildi; tam metin okunmaz.
Özet (abstract)
Minimizing code size is a central problem in compiler optimization, especially in the context of embedded systems and mobile applications. One of the classical optimizations that has recently been adopted to reduce the output code size is function inlining, i.e. repeatedly replacing a function call site by the body of the called function. At first glance, the fact that inlining can help reduce code size is counter-intuitive. However, it enables two types of subsequent optimizations which can affect the code size significantly: (i) the intra-procedural optimizations performed within each function, which make use of the additional context provided by inlining, and (ii) the elimination of dead functions. Many existing heuristics, such as those used by LLVM, focus on a local size analysis based on a few call sites. Thus, they miss the global opportunities to remove dead functions. On the other hand, the current state-of-the-art approach of auto-tuning by Theodoridis et al. [ASPLOS 2022] focuses on global code size but inspects each call site independently in order to avoid a combinatorial explosion. However, inlining decisions are not independent in practice. It is possible that two inlining choices each increase code size on their own, but applying both of them together reduces the size. In this work, we show that the problem of optimal inlining for code size minimization is NP-hard. We then present a completely different approach to this problem. Our algorithm is based on equality graphs (e-graphs), which are a standard tool in automated theorem proving and have recently been adopted by the compiler optimization community as a key ingredient in equality saturation. We show that optimal function inlining can be reduced to e-graph extraction. Although e-graph extraction is also NP-hard, there are efficient solvers that can handle sparse instances of this problem [OOPSLA 2024]. We build upon these solvers and add further inlining-specific heuristics to design an algorithm for code size reduction. Finally, we present experimental results on the standard SPEC benchmarks. Compared with LLVM, our approach reduces the code size to 95.34%. This is competitive with the state-of-the-art auto-tuning method of [ASPLOS 2022], which achieves 95.24%. In terms of running time, our approach is 20x faster than auto-tuning. More importantly, due to the two methods having orthogonal strengths, applying both of them leads to a further significant improvement, reducing the code size to 93.94% of LLVM's output.
Yazarların özeti; kaynağından alınmıştır. Proceedings of the ACM on Programming Languages, 2026 · DOI ↗
Ücretsiz hesapla devam et
Makaleye Sor ile bu makaleye günde 3 soru ücretsiz; makaleyi kaydet, kaynakçasını al, ilgi alanına göre her gün yeni özetler. Çıkarımlar Premium.
Web'de ücretsiz devam etGoogle ya da Apple hesabınla giriş; kart istemez. Bu makaleye geri dönersin.
Telefonda:
Alan: Donanım ve Mimari
Hardware and ArchitectureComputer Science