Open Access
7
- https://doi.org/10.1145/3475738.3480943
Using machine learning to predict the code size impact of duplication heuristics in a dynamic compiler
- Sep 29, 2021
- Raphael Mosaner +3 more
Code duplication is a major opportunity to enable optimizations in subsequent compiler phases. However, duplicating code prematurely or too liberally can result in tremendous code size increases. Thus, modern compilers use trade-offs between estimated costs in terms of code size increase and benefits in terms of performance increase. In the context of this ongoing research project, we propose the use of machine learning to provide trade-off functions with accurate predictions for code size impact. To evaluate our approach, we implemented a neural network predictor in the GraalVM compiler and compared its performance against a human-crafted, highly tuned heuristic. First results show promising performance improvements, leading to code size reductions of more than 10% for several benchmarks. Additionally, we present an assistance mode for finding flaws in the human-crafted heuristic, leading to improvements for the duplication optimization itself.
- # Code Size
- # Code Size Increase
- # Dynamic Compiler
- # Modern Compilers
- # Code Duplication
- # Benefits In Terms
- # Subsequent Phases
- # Code Size Reductions
- # Assistance Mode
- # Subsequent Compiler