Optimizing for reduced code space using genetic algorithms
- 1 May 1999
- proceedings article
- Published by Association for Computing Machinery (ACM)
- Vol. 34 (7) , 1-9
- https://doi.org/10.1145/314403.314414
Abstract
Code space is a critical issue facing designers of software for embedded systems. Many traditional compiler optimizations are designed to reduce the execution time of compiled code, but not necessarily the size of the compiled code. Further, different results can be achieved by running some optimizations more than once and changing the order in which optimizations are applied. Register allocation only complicates matters, as the interactions between different optimizations can cause more spill code to be generated. The compiler for embedded systems, then, must take care to use the best sequence of optimizations to minimize code space.Since much of the code for embedded systems is compiled once and then burned into ROM, the software designer will often tolerate much longer compile times in the hope of reducing the size of the compiled code. We take advantage of this by using a genetic algorithm to find optimization sequences that generate small object codes. The solutions generated by this algorithm are compared to solutions found using a fixed optimization sequence and solutions found by testing random optimization sequences. Based on the results found by the genetic algorithm, a new fixed sequence is developed to reduce code size. Finally, we explore the idea of using different optimization sequences for different modules and functions of the same program.Keywords
This publication has 9 references indexed in Scilit:
- Optimal code motionACM Transactions on Programming Languages and Systems, 1994
- Effective partial redundancy eliminationPublished by Association for Computing Machinery (ACM) ,1994
- Improvements to graph coloring register allocationACM Transactions on Programming Languages and Systems, 1994
- A variation of Knoop, Rüthing, and Steffen's Lazy Code MotionACM SIGPLAN Notices, 1993
- Efficiently computing static single assignment form and the control dependence graphACM Transactions on Programming Languages and Systems, 1991
- Constant propagation with conditional branchesACM Transactions on Programming Languages and Systems, 1991
- A solution to a problem with Morel and Renvoise's “Global optimization by suppression of partial redundancies”ACM Transactions on Programming Languages and Systems, 1988
- Register allocation via coloringComputer Languages, 1981
- Global optimization by suppression of partial redundanciesCommunications of the ACM, 1979