ABSTRACT
This paper presents a novel combinatorial model that integrates global register allocation based on ultimate coalescing, spill code optimization, register packing, and multiple register banks with instruction scheduling (including VLIW). The model exploits alternative temporaries that hold the same value as a new concept for ultimate coalescing and spill code optimization.
The paper presents Unison as a code generator based on the model and advanced solving techniques using constraint programming. Thorough experiments using MediaBench and a processor (Hexagon) that are typical for embedded systems demonstrate that Unison: is robust and scalable; generates faster code than LLVM (up to 41% with a mean improvement of 7%); possibly generates optimal code (for 29% of the experiments); effortlessly supports different optimization criteria (code size on par with LLVM).
Unison is significant as it addresses the same aspects as traditional code generation algorithms, yet is based on a simple integrated model and robustly can generate optimal code.
- A. W. Appel and L. George. Optimal spilling for CISC machines with few registers. SIGPLAN Not., 36:243--253, May 2001. Google ScholarDigital Library
- S. Bashford and R. Leupers. Phase-coupled mapping of data flow graphs to irregular data paths. Design Automation for Embedded Systems, pages 119--165, Mar. 1999.Google Scholar
- R. Castañeda Lozano, M. Carlsson, F. Drejhammar, and C. Schulte. Constraint-based register allocation and instruction scheduling. In CP, volume 7514 of LNCS, pages 750--766. Springer, 2012. Google ScholarDigital Library
- G. J. Chaitin, M. A. Auslander, A. K. Chandra, J. Cocke, M. E. Hopkins, and P.W. Markstein. Register allocation via coloring. Computer Languages, 6(1):47--57, 1981. Google ScholarDigital Library
- C.-M. Chang, C.-M. Chen, and C.-T. King. Using integer linear programming for instruction scheduling and register allocation in multiissue processors. Computers Math. Applic., 34:1--14, Nov. 1997.Google ScholarCross Ref
- F. Chow and J. Hennessy. Register allocation by priority-based coloring. SIGPLAN Not., 19(6):222--232, June 1984. Google ScholarDigital Library
- M. V. Eriksson, O. Skoog, and C. W. Kessler. Optimal vs. heuristic integrated code generation for clustered VLIW architectures. In SCOPES, 2008. Google ScholarCross Ref
- C. H. Gebotys. An efficient model for DSP code generation: Performance, code size, estimated energy. In ISSS, pages 41--47. IEEE, 1997. Google ScholarDigital Library
- Gecode Team. Gecode: generic constraint development environment. www.gecode.org, 2006.Google Scholar
- D. W. Goodwin and K. D. Wilken. Optimal and near-optimal global register allocations using 0--1 integer programming. Software -- Practice and Experience, 26:929--965, Aug. 1996. Google ScholarDigital Library
- D. Kästner. PROPAN: A retargetable system for postpass optimisations and analyses. In LCTES, volume 1985 of LNCS, 2001.Google Scholar
- P. K. Krause. Optimal register allocation in polynomial time. In CC, volume 7791 of LNCS, pages 1--20. Springer, 2013. Google ScholarDigital Library
- C. Lee, M. Potkonjak, and W. H. Mangione-Smith. MediaBench: A tool for evaluating and synthesizing multimedia and communications systems. In MICRO-30, pages 330--335. IEEE, 1997. Google ScholarDigital Library
- S. G. Nagarakatte and R. Govindarajan. Register allocation and optimal spill code scheduling in software pipelined loops using 0--1 integer linear programming formulation. In CC, volume 4420 of LNCS, pages 126--140. Springer, 2007. Google ScholarDigital Library
- Hexagon V4 Programmer's Reference Manual. Qualcomm Technologies, Inc., Aug. 2013.Google Scholar
- B. R. Rau and J. A. Fisher. Instruction-level parallel processing: history, overview, and perspective. J. Supercomput., 7:9--50, May 1993. Google ScholarDigital Library
- F. Rossi, P. van Beek, and T. Walsh. Handbook of Constraint Programming. Elsevier, 2006. Google ScholarDigital Library
- B. Scholz and E. Eckstein. Register allocation for irregular architectures. SIGPLAN Not., 37:139--148, June 2002. Google ScholarDigital Library
- V. Sreedhar, R. Ju, D. Gillies, and V. Santhanam. Translating out of static single assignment form. In SAS, volume 1694 of LNCS, pages 849--849. Springer, 1999. Google ScholarDigital Library
- T. Wilson, G. Grewal, B. Halley, and D. Banerji. An integrated approach to retargetable code generation. In ISSS, pages 70--75. IEEE, 1994. Google ScholarDigital Library
- T. Wilson, G. Grewal, S. Henshall, and D. Banerji. An ILP-based approach to code generation. In Code Generation for Embedded Processors, pages 103--118. Springer, 2002.Google ScholarCross Ref
- S. Winkel. Optimal versus heuristic global code scheduling. In MICRO-40, pages 43--55. IEEE, 2007. Google ScholarDigital Library
Index Terms
- Combinatorial spill code optimization and ultimate coalescing
Recommendations
Combinatorial Register Allocation and Instruction Scheduling
This article introduces a combinatorial optimization approach to register allocation and instruction scheduling, two central compiler problems. Combinatorial optimization has the potential to solve these problems optimally and to exploit processor-...
Combinatorial spill code optimization and ultimate coalescing
LCTES '14This paper presents a novel combinatorial model that integrates global register allocation based on ultimate coalescing, spill code optimization, register packing, and multiple register banks with instruction scheduling (including VLIW). The model ...
Evaluating Register Allocation and Instruction Scheduling Techniques in Out-Of-Order Issue Processors
PACT '99: Proceedings of the 1999 International Conference on Parallel Architectures and Compilation TechniquesThe phase ordering of register allocation and instruction scheduling in a compiler and their integration have been well studied for in-order issue and VLIW processors. In this paper we study this problem in the context of out-of-order issue processors. ...
Comments