CFP last date
20 December 2024
Reseach Article

Compiler Optimization: A Genetic Algorithm Approach

by Prathibha A. Ballal, H. Sarojadevi, Harsha P S
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
Volume 112 - Number 10
Year of Publication: 2015
Authors: Prathibha A. Ballal, H. Sarojadevi, Harsha P S
10.5120/19701-0938

Prathibha A. Ballal, H. Sarojadevi, Harsha P S . Compiler Optimization: A Genetic Algorithm Approach. International Journal of Computer Applications. 112, 10 ( February 2015), 9-13. DOI=10.5120/19701-0938

@article{ 10.5120/19701-0938,
author = { Prathibha A. Ballal, H. Sarojadevi, Harsha P S },
title = { Compiler Optimization: A Genetic Algorithm Approach },
journal = { International Journal of Computer Applications },
issue_date = { February 2015 },
volume = { 112 },
number = { 10 },
month = { February },
year = { 2015 },
issn = { 0975-8887 },
pages = { 9-13 },
numpages = {9},
url = { https://ijcaonline.org/archives/volume112/number10/19701-0938/ },
doi = { 10.5120/19701-0938 },
publisher = {Foundation of Computer Science (FCS), NY, USA},
address = {New York, USA}
}
%0 Journal Article
%1 2024-02-06T22:49:05.531196+05:30
%A Prathibha A. Ballal
%A H. Sarojadevi
%A Harsha P S
%T Compiler Optimization: A Genetic Algorithm Approach
%J International Journal of Computer Applications
%@ 0975-8887
%V 112
%N 10
%P 9-13
%D 2015
%I Foundation of Computer Science (FCS), NY, USA
Abstract

Compiler optimization is the technique of minimizing or maximizing some features of an executable code by tuning the output of a compiler. Minimizing the execution time of the code generated is a priority in optimization; other attributes include minimizing the size of the executable code. The generation of fast executables begins at code design phase up until the compilation process is complete. Even though compilers are at the tail end of generating fast executables, the right flag used during compilation, would provide substantial performance gain. Though, compilers provide a large number of flags(GNU compiler) to control optimization, often the programmer opts for the simpler method, which is to merely choose the optimization level. The choice of optimization level automatically dictates the flags chosen by the compiler. In this paper, we access at the gain provided by using optimization levels, also we propose a genetic algorithm to determine the combination of flags, that could be used, to generate efficient executable in terms of time. The input population to the genetic algorithm is the set of compiler flags that can be used to compile a program and the best chromosome corresponding to the best combination of flags is derived over generations, based on the time taken to compile and execute, as the fitness function. The experimental analysis shows that genetic algorithm is a suitable candidate to find an optimal solution if the solution space is large, which otherwise would have been very difficult to identify, due to the large set of flags available in the GCC compiler for optimization alone. Also the best combination of flags is application dependent.

References
  1. Han Lee1,, Daniel Von Dincklage,1 Amer Diwan,1,_And J. Eliot B. Moss, "Understanding The Behavior Of Compiler Optimizations" Software Practice And Experience, 2004; 01:1–2
  2. Kenneth Hoste Lieven Eeckhout,,COLE: Compiler Optimization Level Exploration,CGO'08, April 5–10, 2008, Boston, Massachusetts, USA. ,Copyright 2008 ACM 978-1-59593-978-4/08/04
  3. "Compilers: Principles, Techniques, And Tools"Alfred V. Aho, Monica S. Lam, Ravi Sethi, And Jeffrey D. Ullman
  4. http://en. wikipedia. org/wiki/Genetic_algorithm
  5. http://gcc. gnu. org/onlinedocs/gcc/Optimize-ptions. html.
  6. http://www. network-theory. co. ukdocs/gccintro/ gccintro_49. html
  7. http://lampwww. epfl. ch /~fsalvi/docs/ gcc/www. network-theory. co. uk/docs/ gccintro /gccintro_42. html
  8. Rodrigo D. Escobar, Alekya R. Angula, Mark Corsi, "Evaluation of GCC Optimization Parameters", Ing. USBMed, Vol. 3, No. 2, pp. 31-39, December, 2012.
  9. Elana Granston, Anne Holler, "Automatic Recommendation of Compiler Options", California Language Lab, Hewlett-Packard Industry, U. S patents 5,960,202 and 5,966,538.
  10. Jeyaraj Andrews, Thangappan Sasikala, "Evaluation of various Compiler Optimization Techniques Related to Mibench Benchmark Applications", Journal of Computer Science 9 (6): 749-756, 2013.
  11. Wind River Systems, "Advanced compiler optimization techniques" April 2002. Online [December. 2012].
  12. Scott Robert Ladd,, "Acovea: Analysis of Compiler Options via Evolutionary Algorithm" Describing the EvolutionaryAlgorithm", http://stderr. org /doc / acovea /html/acoveaga. html.
Index Terms

Computer Science
Information Sciences

Keywords

Compiler Flags Optimization Fitness function Population Generation.