Alternativní algoritmus stavby SSA formy pro GCC
An alternative SSA construction algorithm for GCC
bachelor thesis (DEFENDED)

View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/184209Identifiers
Study Information System: 258053
Collections
- Kvalifikační práce [11325]
Author
Advisor
Referee
Jambor, Martin
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Computer Science with specialisation in General Computer Science
Department
Department of Applied Mathematics
Date of defense
7. 9. 2023
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
Czech
Grade
Excellent
Keywords (Czech)
překladač|SSA|optimalizaceKeywords (English)
compiler|SSA|optimizationSSA forma je velice důležitý koncept týkající se interní reprezentace kódu v překladačích. Φ-funkce jsou nedílná součást SSA formy. Braun, Buchwald, Hack, Leißa, Mallon a Zwinkau představují nový algoritmus pro stavbu SSA a společně s ním také algoritmus redukující množství Φ-funkcí. V GCC zatím tyto algoritmy nebyly implementovány. V této práci nejprve představíme, naimplementujeme a otestujeme základní API určené pro generování kódu, které je založené na zmíněném algoritmu pro stavbu SSA. Následně předvedeme možnosti využití tohoto API a uvedeme jeho možná rozšíření. Poté naimplementujeme algoritmus pro optimalizaci Φ- funkcí. Pomocí tohoto algoritmu změříme, kolik redundantních Φ-funkcí pro- dukují GCC optimalizační průchody. Na základě získaných poznatků nakonec dojdeme k závěru, že by bylo užitečné tyto algoritmy do GCC přidat. 1
SSA form is a very important concept in compiler internal code representa- tion. Φ-functions are an integral part of SSA form. Braun, Buchwald, Hack, Leißa, Mallon and Zwinkau introduce a new algorithm for SSA construction and another related algorithm for reducing the number of Φ-functions. These algorithms are not yet implemented in the GCC compiler. Firstly, we introduce, implement and test a basic code generation API based on the SSA construction algorithm. We list the possible extensions and usecases of the API. Then we implement the Φ optimization as a standalone pass. We use it to measure the number of redundant Φ-functions produced by other GCC passes. Finally, we conclude that GCC would benefit from including both of these algorithms. 1