ORIGINAL RESEARCH article
Front. Robot. AI
Sec. Multi-Robot Systems
Control Flow Graph Based Code Optimization Using Graph Neural Networks
Melih Peker 1
Ozcan Ozturk 2
1. Bilkent Universitesi, Ankara, Türkiye
2. Sabanci Universitesi Muhendislik ve Doga Bilimleri Fakultesi, Istanbul, Türkiye
Select one of your emails
You have multiple emails registered with Frontiers:
Notify me on publication
Please enter your email address:
If you already have an account, please login
You don't have a Frontiers account ? You can register here
Abstract
Abstract—Selecting a good set of optimization flags requires extensive effort and expert input. While most of the prior research considers using static, spatial, or dynamic features, some of the latest research directly applied deep neural networks to source code. We combined the static features, spatial features, and deep neural networks by representing source code as graphs and trained Graph Neural Network (GNN) for automatically finding suitable optimization flags. We created a dataset of 12000 graphs using 256 optimization flag combinations on 47 benchmarks. We trained and tested our model using these benchmarks, and our results show that we can achieve a maximum of 48.6% speed-up compared to the case where all optimization flags are enabled.
Summary
Keywords
Code optimization, Compilers, FLAG, GCC, Graph neural networks
Received
24 October 2025
Accepted
09 February 2026
Copyright
© 2026 Peker and Ozturk. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) or licensor are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Ozcan Ozturk
Disclaimer
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.