ACM Transactions on Architecture and Code Optimization · 2013 · 25 citations · 16 references
ComputingComputer EngineeringComputer ScienceAlgorithmsCompilersSchedulingCode GenerationCpu SchedulingInstruction SchedulingInstruction-level ParallelismPerformance OptimizationRegister AllocationCombinatorial SearchCost Function ModelingInstruction Scheduling AlgorithmsOptimal Instruction SchedulingRegister PressureRegister Pressure MinimizationRegister-pressure-aware Instruction Selection
Balancing Instruction-Level Parallelism (ILP) and register pressure during preallocation instruction scheduling is a fundamentally important problem in code generation and optimization. The problem is known to be NP-complete. Many heuristic techniques have been proposed to solve this problem. However, due to the inherently conflicting requirements of maximizing ILP and minimizing register pressure, heuristic techniques may produce poor schedules in many cases. If such cases occur in hot code, significant performance degradation may result. A few combinatorial optimization approaches have also been proposed, but none of them has been shown to solve large real-world instances within reasonable time. This article presents the first combinatorial algorithm that is efficient enough to optimally solve large instances of this problem (basic blocks with hundreds of instructions) within a few seconds per instance. The proposed algorithm uses branch-and-bound enumeration with a number of powerful pruning techniques to efficiently search the solution space. The search is based on a cost function that incorporates schedule length and register pressure. An implementation of the proposed scheduling algorithm has been integrated into the LLVM Compiler and evaluated using SPEC CPU 2006. On x86-64, with a time limit of 10ms per instruction, it optimally schedules 79% of the hot basic blocks in FP2006. Another 19% of the blocks are not optimally scheduled but are improved in cost relative to LLVM's heuristic. This improves the execution time of some benchmarks by up to 21%, with a geometric-mean improvement of 2.4% across the entire benchmark suite. With the use of precise latency information, the geometric-mean improvement is increased to 2.8%.
16
Code scheduling and register allocation in large basic blocks
James Goodman, Wei‐Chung Hsu · 2014 · 178 citations
Code scheduling and register allocation in large basic blocks
J. R. Goodman, W.-C. Hsu · 1988 · 140 citations · Full text
Optimal versus Heuristic Global Code Scheduling
Sebastian Winkel · 2007 · 63 citations