摘要
寄存器是处理器硬件中有限的宝贵资源,这使得寄存器分配成为编译器中最为关键的过程之一。影响寄存器分配效果的关键因素之一是溢出带来的访存开销。针对DSP处理器具有两类通用寄存器的情况,以图着色全局寄存器分配方法为基本方法,提出两类寄存器间的一种互补利用策略和相应的寄存器溢出优化算法。该策略改进了传统图着色方法,通过生命周期分析的结果,将同类寄存器分配候选者之间的冲突关系和不同类寄存器分配候选者之间的冲突关系区分开来,并把它们表示在一张无向图中。与传统的图着色算法相比,改进的算法能充分考虑不同类寄存器之间的相互约束关系,减少寄存器溢出时的访存操作,从而有利于提高代码的性能。
Register allocation has become one of the most important optimization techniques for compiler for that registers are limited and valuable resources in hardware architecture of computer.One of the key factors affecting the results of register allocation is the access and storage costs incurred from spilling signed registers.For DSP architectures with two classes of general-purpose registers,this paper proposed a complementary utilization strategy between the registers and a corresponding register spilling optimization algorithm on the basis of graph coloring register allocation method.Through distinguishing the interference between candidates of the same register class from those of different register classes,an undirected graph is built by improving the analysis for variables’live ranges.Compared with the conventional graph coloring register allocation,the improved algorithm fully consideres the interferences among the register allocation candidates for two register classes,thus achiving less memory access operations in register spilling and higher code performance.
作者
邱亚琼
胡勇华
李阳
唐镇
石林
QIU Ya-qiong;HU Yong-hua;LI Yang;TANG Zhen;SHI Lin(School of Computer Science and Engineering,Hunan University of Science and Technology,Xiangtan,Hunan 411201,China)
出处
《计算机科学》
CSCD
北大核心
2019年第6期196-200,共5页
Computer Science
基金
国家自然科学基金(61308001)
湖南省自然科学基金(2017JJ3087)资助
关键词
寄存器分配
编译器
图着色方法
寄存器溢出
优化
Register allocation
Compiler
Graph coloring algorithm
Register spilling
Optimization