arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1202.5539cs.PL
收藏

基于模型Transformer语义的寄存器分配

Register Allocation By Model Transformer Semantics

Yin Wang, R. Kent Dybvig

摘要:

寄存器分配长期以来被公式化为图着色问题,用物理寄存器对冲突图着色。这样的公式没有完全捕获分配的目标,即最小化寄存器和存储器之间的通信量。线性扫描已经被提出作为图着色的替代方案,但本质上,它可以被视为图着色的贪心算法:不是按照顶点的度的顺序,而是按照它们在程序中出现的顺序对顶点进行着色。因此,它受到几乎相同的限制,图着色。在本文中,我提出了一种新的寄存器分配方法的基础上的思想模型Transformer语义(MTS)和静态缓存替换(SCR)。模型Transformer语义捕获寄存器和堆栈的语义。静态缓存替换放宽了图着色和线性扫描所做的假设,旨在直接减少寄存器内存流量。该方法比图着色和线性扫描方法探索更大的解空间,从而提供了更多的优化机会。它无缝地执行活动范围分割,这是对图着色和线性扫描的扩展中的优化。同时,它简化了编译器,其基于语义的方法为简化编译器的形式化验证提供了可能。

英文摘要:

Register allocation has long been formulated as a graph coloring problem, coloring the conflict graph with physical registers. Such a formulation does not fully capture the goal of the allocation, which is to minimize the traffic between registers and memory. Linear scan has been proposed as an alternative to graph coloring, but in essence, it can be viewed as a greedy algorithm for graph coloring: coloring the vertices not in the order of their degrees, but in the order of their occurence in the program. Thus it suffers from almost the same constraints as graph coloring. In this article, I propose a new method of register allocation based on the ideas of model transformer semantics (MTS) and static cache replacement (SCR). Model transformer semantics captures the semantics of registers and the stack. Static cache replacement relaxes the assumptions made by graph coloring and linear scan, aiming directly at reducing register-memory traffic. The method explores a much larger solution space than that of graph coloring and linear scan, thus providing more opportunities of optimization. It seamlessly performs live range splitting, an optimization found in extensions to graph coloring and linear scan. Also, it simplifies the compiler, and its semantics-based approach provides possibilities of simplifying the formal verification of compilers.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑