Christian Wimmer

Automatic Construction of Inlining Heuristics using Machine Learning

Sameer Kulkarni, John Cavazos, Christian Wimmer, Douglas Simon: Automatic Construction of Inlining Heuristics using Machine Learning. In Proceedings of the International Symposium on Code Generation and Optimization. IEEE, 2013. doi:10.1109/CGO.2013.6495004

Download preprint as PDF

Abstract

Method inlining is considered to be one of the most important optimizations in a compiler. However, a poor inlining heuristic can lead to significant degradation of a program's running time. Therefore, it is important that an inliner has an effective heuristic that controls whether a method is inlined or not. An important component of any inlining heuristic are the features that characterize the inlining decision. These features often correspond to the caller method and the callee methods. However, it is not always apparent what the most important features are for this problem or the relative importance of these features. Compiler writers developing inlining heuristics may exclude critical information that can be obtained during each inlining decision.

In this paper, we use a machine learning technique, namely neuro-evolution, to automatically induce effective inlining heuristics from a set of features deemed to be useful for inlining. Our learning technique is able to induce novel heuristics that significantly out-perform manually-constructed inlining heuristics. We evaluate the heuristic constructed by our neuro-evolutionary technique within the highly tuned Java HotSpot server compiler and the Maxine VM C1X compiler, and we are able to obtain speedups of up to 89% and 114%, respectively. In addition, we obtain an average speedup of almost 9% and 11% for the Java HotSpot VM and Maxine VM, respectively. However, the output of neuro-evolution, a neural network, is not human readable. We show how to construct more concise and readable heuristics in the form of decision trees that perform as well as our neuro-evolutionary approach.