Загрузка...

2025 US LLVM Developers' Meeting: Optimizing generic code lowering to LLVM-IR

2025 US LLVM Developers' Meeting

https://llvm.org/devmtg/2025-10/

------

Title: Optimizing generic code lowering to LLVM-IR through function equivalence coalescing

Speaker: Alina Sbirlea

------

Slides: https://llvm.org/devmtg/2025-10/slides/quick_talks/sbirlea.pdf

-----

This talk describes a solution for the problem of duplicate LLVM IR functions being emitted when lowering generic code such as C++ templates, and generics in Rust, Swift, or Carbon. The aim is to tackle the issue of code size and high compile-times, originally impacting C++ templates, for which a front end approach is expected to be more efficient than LLVM's function merging pass. We present an algorithm for coalescing different front-end level functions into a single LLVM IR function when such functions are equivalent in LLVM IR. For this, we use LLVM types for building a canonical fingerprint for functions, even when such types are distinct in the language's front end. We implement this proof of concept in Carbon's front end during the lowering to LLVM-IR stage. The algorithm determines if two functions are equivalent by considering their SemIR (Carbon's IR) representation and their lowered LLVM type information, handling recursion through strongly-connected components (SCCs) call graph analysis, and using two types of fingerprints in order to identify potential equivalences. We also discuss alternatives and future improvements.

-----

Videos Edited by Bash Films: http://www.BashFilms.com

Видео 2025 US LLVM Developers' Meeting: Optimizing generic code lowering to LLVM-IR канала LLVM
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять