Search-Based Optimization for Compiler Machine-Code Generation

Date and time: 
Fri, Jul 26 2013 - 9:30am
Location: 
220 Deschutes
Speaker(s):
Aran Clauson
University of Oregon
Host/Committee: 
  • Christopher Wilson (Co-Chair)
  • Matthew L. Ginsberg (Co-Chair)
  • Michal Young
  • David A. Levin - Mathematics
  • Bart Massey - Portland State University

Compilation encompasses many steps. Parsing turns the input program into a more manageable syntax tree. Verification ensures that the program makes some semblance of sense. Finally, code generation transforms the internal abstract program representation into an executable program. Compilers strive to produce the best possible programs and optimizations are applied at nearly every level of compilation.

Instruction Scheduling is one of the last compilation tasks. It is part of code generation and replaces the internal graph representation of the program with an instruction sequence. The scheduler should produce not just any sequence but one that the hardware can execute quickly. Considering that Instruction Scheduling is an NP-Complete optimization problem, it is interesting that schedules are usually generated by a greedy, heuristic algorithm called List Scheduling.

Given search-based algorithms' successes in other NP-Complete optimization domains, we ask weather search-based algorithms can be applied to Instruction Scheduling and generate superior schedules without unacceptably increasing compilation time.

To answer this question we formulate a problem description that captures practical scheduling constraints and we show that this problem is NP-Complete with modest requirements on the actual hardware. We adapt three different search algorithms to Instruction Scheduling and show that search is an effective Instruction Scheduling technique. The generated schedules are generally shorter than those generated by List Scheduling. Search-based scheduling does take more time, but the increases are acceptable for some compilation domains.