arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.07627cs.PL
收藏

程序流图的系列-并行-环分解

Series-Parallel-Loop Decompositions of Control-flow Graphs

University of Oxford(牛津大学);Hong Kong University of Science and Technology(香港科技大学)

Xuran Cai, Amir Goharshady, S Hitarth, Chun Kit Lam

AI总结:

本文提出了一种基于语法的分解框架,精确刻画结构化程序生成的控制流图,改进了寄存器分配和生命周期最优推测性部分冗余消除算法,展示了针对CFGs的分解方法在性能上的优势。

摘要:

结构化程序的控制流图(CFGs)以其强稀疏性而闻名。传统上,这种稀疏性通过图参数如树宽和路径宽来建模,从而能够开发出更快的参数化算法,用于编译优化、模型检查和程序分析等任务。然而,这些参数只能近似表示CFGs的结构约束:虽然每个结构化CFG的树宽最多为7,但许多树宽不超过7的图无法作为CFGs出现。因此,现有的参数化技术是为更广泛的图类优化的,而实际应用中遇到的图类远比这狭窄。在本工作中,我们引入了一个基于语法的分解框架,该框架精确地刻画了由结构化程序生成的控制流图的类别。我们的分解直观,反映了程序的语法结构,并且完全兼容基于树宽方法的动态规划范式。使用该框架,我们为两个经典的编译优化问题设计了改进的算法:寄存器分配和最优生命周期推测性部分冗余消除(LOSPRE)。广泛的实验评估显示,与之前最先进的方法相比,有显著的性能提升,突显了使用专门针对CFGs的分解方法的好处。

英文摘要:

Control-flow graphs (CFGs) of structured programs are well known to exhibit strong sparsity properties. Traditionally, this sparsity has been modeled using graph parameters such as treewidth and pathwidth, enabling the development of faster parameterized algorithms for tasks in compiler optimization, model checking, and program analysis. However, these parameters only approximate the structural constraints of CFGs: although every structured CFG has treewidth at most~7, many graphs with treewidth at most~7 cannot arise as CFGs. As a result, existing parameterized techniques are optimized for a substantially broader class of graphs than those encountered in practice. In this work, we introduce a new grammar-based decomposition framework that characterizes \emph{exactly} the class of control-flow graphs generated by structured programs. Our decomposition is intuitive, mirrors the syntactic structure of programs, and remains fully compatible with the dynamic-programming paradigm of treewidth-based methods. Using this framework, we design improved algorithms for two classical compiler optimization problems: \emph{Register Allocation} and \emph{Lifetime-Optimal Speculative Partial Redundancy Elimination (LOSPRE)}. Extensive experimental evaluation demonstrates significant performance improvements over previous state-of-the-art approaches, highlighting the benefits of using decompositions tailored specifically to CFGs.

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

↑