期刊文献+

一种基于分区域优先级的寄存器分配算法 被引量:3

A Register Allocation Algorithm Based on Regions Priority
下载PDF
导出
摘要 编译器速度和生成代码质量是衡量寄存器分配阶段性能的两个关键因素,现代的即时编译器要求在尽可能短的时间内编译出高质量的代码。传统的基于图着色的算法和线性扫描算法均不能很好地满足这个要求,该文提出一种基于矩阵填充的区域优先级寄存器分配算法,不追求理论上完美的寄存器分配,而采用贪婪式的方法,对程序循环区域进行分割,按区域内生命域的长度和溢出权重两种优先级排序方法进行物理寄存器分配,再扩展到整个程序段。算法在保留线性分配时间的同时产生了高质量的代码,应用于编译SSA形式的PTX指令到多核平台的过程中,基于该编译平台的实验证明了该文改进算法的有效性。 Compiling speed and code quality are two key factors to evaluate the performance of register allocation. Modern Just In Time (JIT) compilers desire the best code in least time. Neither traditional graph coloring algorithm nor linear scan algorithm can satisfy the condition perfectly. A regions priority algorithm is proposed in this paper, which does not pursue the perfect register allocation in theory but takes greedy design method. The program is divided by loop region, on which physical register allocation is implemented by dealing lifetime length priority queue and spill weight priority queue. Then the allocation extends to the whole program. This algorithm creates high quality code in linear time and is applied to the compiler which compiles PTX instructions in SSA to traditional multicore platform. The experiment based on this compiler verifies the effectiveness of the algorithm.
出处 《电子与信息学报》 EI CSCD 北大核心 2013年第12期3005-3010,共6页 Journal of Electronics & Information Technology
基金 国家高技术研究发展计划(2009AA012201) 国家核高基重大专项(2009ZX01036-001-001) 河南省重大科技攻关专项(092101210501)资助课题
关键词 编译器 寄存器分配 循环区域分割 贪婪法 生命域长度优先级 溢出权重优先级 Compiler Register allocation Loop region divide Greedy Lifetime length priority Spill weight priority
  • 相关文献

参考文献19

  • 1Poletto M. Linear scan register allocation[J].ACM Transactions on Programming Languages and Systems,1999,(05):895-913.
  • 2Sagonas K,Stenman E. Experimental evaluation and improvements to linear scan register allocation[J].Software:Practice and Experience,2003,(11):1003-1034.doi:10.1002/spe.533.
  • 3Kempe A B. On the geographical problem of the four colors[J].American Journal of Mathematics,1979,(03):193-200.
  • 4Chaitin G J. Register allocation and spilling via graph coloring[J].Symposium on Compiler Construction,1982,(06):98-105.
  • 5Gregory J C,Mark A A,Ashok K C. Register allocation via coloring[J].Computer Languages,1981,(01):47-57.
  • 6Cytron R,Ferrante J,Rosen B K. Efficiently computing static single assignment form and the control dependence graph[J].ACM Transactions on Programming Languages and Systems,1991,(04):451-490.
  • 7Hack S,Grund D,Goos G. Register allocation for programs in SSA-form[A].Heidelberg,2006.247-262.
  • 8Gavril F. Algorithms for minimum coloring,maximum clique,minimum covering by cliques,and maximum independent set of a chordal graph[J].SIAM Journal on Computing(SICOMP),1972,(02):180-187.
  • 9Wimmer C,Franz M. Linear scan register allocation on SSA form[A].Toronto,Ontario,Canada,2010.170-179.
  • 10Evlogimenos A. Improvements to linear scan register allocation[R].Technical Report,University of Illinois,Urbana-Champaign,2004.

同被引文献37

引证文献3

二级引证文献3

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部