Predicting Unroll Factors Using Supervised Classification

  • Authors:
  • Mark Stephenson;Saman Amarasinghe

  • Affiliations:
  • Massachusetts Institute of Technology, Cambridge;Massachusetts Institute of Technology, Cambridge

  • Venue:
  • Proceedings of the international symposium on Code generation and optimization
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

Compilers base many critical decisions on abstracted architectural models. While recent research has shown that modeling is effective for some compiler problems, building accurate models requires a great deal of human time and effort. This paper describes how machine learning techniques can be leveraged to help compiler writers model complex systems. Because learning techniques can effectively make sense of high dimensional spaces, they can be a valuable tool for clarifying and discerning complex decision boundaries. In this work we focus on loop unrolling, a well-known optimization for exposing instruction level parallelism. Using the Open Research Compiler as a testbed, we demonstrate how one can use supervised learning techniques to determine the appropriateness of loop unrolling. We use more than 2,500 loops - drawn from 72 benchmarks - to train two different learning algorithms to predict unroll factors (i.e., the amount by which to unroll a loop) for any novel loop. The technique correctly predicts the unroll factor for 65% of the loops in our dataset, which leads to a 5% overall improvement for the SPEC 2000 benchmark suite (9% for the SPEC 2000 floating point benchmarks).