Optimizing for reduced code space using genetic algorithms

Citation
Kd. Cooper et al., Optimizing for reduced code space using genetic algorithms, ACM SIGPL N, 34(7), 1999, pp. 1-9
Citations number
22
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
34
Issue
7
Year of publication
1999
Pages
1 - 9
Database
ISI
SICI code
1523-2867(199907)34:7<1:OFRCSU>2.0.ZU;2-3
Abstract
Code space is a critical issue facing designers of software for embedded sy stems. Many traditional compiler optimizations are designed to reduce the e xecution time of compiled code, but not necessarily the size of the compile d code. Further, different results can be achieved by running some optimiza tions more than once and changing the order in which optimizations are appl ied. Register allocation only complicates matters, as the interactions betw een different optimizations can cause more spill code to be generated. The compiler for embedded systems, then, must take care to use the best sequenc e of optimizations to minimize code space. Since much of the code for embedded systems is compiled once and then burne d into ROM, the software designer will often tolerate much longer compile t imes in the hope of reducing the size of the compiled code. We take advanta ge 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 soluti ons found by testing random optimization sequences. Based on the results fo und by the genetic algorithm, a new fixed sequence is developed to reduce c ode size. Finally, we explore the idea of using different optimization sequ ences for different modules and functions of the same program.