Alternativní implementace inlineru v GNU Compiler Collection
Alternativní implementace inlineru v GNU Compiler Collection
bachelor thesis (DEFENDED)
View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/193186Identifiers
Study Information System: 272461
Collections
- Kvalifikační práce [11242]
Author
Advisor
Referee
Jambor, Martin
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Computer Science with specialisation in Foundations of Computer Science
Department
Department of Applied Mathematics
Date of defense
6. 9. 2024
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
English
Grade
Very good
Keywords (Czech)
překladač|interprocedurální optimalizaceKeywords (English)
compiler|inter-procedural optimizationInlinování je velmi důležitou součástí optimalizačních průchodů současných překla- dačů. Nahrazením volání funkce za její tělo se ušetří režie na provedení volání a získá více kontextu pro ostatní optimalizační průchody. V práci prozkoumáme současný "hladový" inliner v GNU Compiler Collection napsaný před více než dvaceti lety a navrhneme alter- nativní algoritmus vhodný pro použití v paralelním prostředí. Spojíme současný přístup používající prioritní frontu a přístup early inlineru procházejícího funkce v topologickém pořadí (reverse post order) tím, že průchod provedeme opakovaně s postupně se zvyšu- jícími limity. Měření naznačují, že navržený algoritmus je hoden dalšího zkoumání a že nastavením vhodných konstant by se mohl postavit současnému inlineru a přesto být připravený na budoucí paralelizování IPA fáze překladu.
Inlining is a very important optimization pass of today's compilers. It saves func- tion call overhead and provides more context for other optimization passes by replacing function's call site with its body. We revisit the current "greedy" inliner in GNU Com- piler Collection, which was written more then 20 years ago and propose an alternative algorithm suitable for parallel processing. We combine the current approach of using a priority queue and the approach of the early inliner of traversing the callgraph in re- verse post order by running the RPO traversal multiple times with increasing limits. Our measurements suggest the presented algorithm is worth further research and that prop- erly tuning the constants may put it on a par with the current inliner all while allowing space for future parallelization of the IPA phase.