POSET-RL: Phase ordering for Optimizing Size and Execution Time using Reinforcement Learning
Authors:
- 1 May 2022
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 121-131
Abstract
The ever increasing memory requirements of several applications has led to increased demands which might not be met by embedded devices. Constraining the usage of memory in such cases is of paramount importance. It is important that such code size improvements should not have a negative impact on the runtime. Improving the execution time while optimizing for code size is a non-trivial but a significant task.The ordering of standard optimization sequences in modern compilers is fixed, and are heuristically created by the compiler domain experts based on their expertise. However, this ordering is sub-optimal, and does not generalize well across all the cases.We present a reinforcement learning based solution to the phase ordering problem, where the ordering improves both the execution time and code size. We propose two different approaches to model the sequences: one by manual ordering, and other based on a graph called Oz Dependence Graph (ODG). Our approach uses minimal data as training set, and is integrated with LLVM.We show results on x86 and AArch64 architectures on the benchmarks from SPEC-CPU 2006, SPEC-CPU 2017 and MiBench. We observe that the proposed model based on ODG outperforms the current Oz sequence both in terms of size and execution time by 6.19% and 11.99% in SPEC 2017 benchmarks, on an average.Keywords
All Related Versions
This publication has 22 references indexed in Scilit:
- COBAYNACM Transactions on Architecture and Code Optimization, 2016
- Identifying Compiler Options to Minimize Energy Consumption for Embedded PlatformsThe Computer Journal, 2013
- Finding good optimization sequences covering program spaceACM Transactions on Architecture and Code Optimization, 2013
- Using machine learning to improve automatic vectorizationACM Transactions on Architecture and Code Optimization, 2012
- SPEC CPU2006 benchmark descriptionsACM SIGARCH Computer Architecture News, 2006
- On the decidability of phase ordering problem in optimizing compilation2006
- Exhaustive Optimization Phase Order Space Exploration2006
- MiBench: A free, commercially representative embedded benchmark suite2005
- Predicting Unroll Factors Using Supervised Classification2005
- Phase coupling and constant generation in an optimizing microcode compilerACM SIGMICRO Newsletter, 1982