基于控制流图的部分约束满足问题的高效算法
Efficient Algorithms for Partial Constraint Satisfaction Problems over Control-flow Graphs
AI总结:
本文提出了一种针对基于SPL分解的控制流图部分约束满足问题的高效算法,时间复杂度为O(|G|·|D|^6),并展示了在最优银行选择任务上的实验结果。
摘要:
在本文中,我们关注基于控制流图(CFG)的部分约束满足问题(PCSP)。PCSP是已知的约束满足问题(CSP)的推广。在CSP框架中,我们定义一组变量、一组约束和一个有限域D,涵盖每个变量的所有可能值。目标是以某种方式为每个变量分配一个值,使得所有约束都得到满足。在CSP的图变种中,考虑一个底层图,并且每个顶点对应一个变量,每个边对应一个或多个约束。在PCSP中,我们允许某些约束在指定成本下被违反,旨在找到总成本最小的解决方案。许多经典的编译器优化任务可以被框架为基于控制流图的PCSP。例如,寄存器分配、生命周期最优的推测性部分冗余消除(LOSPRE)以及最优的银行选择指令放置。另一方面,众所周知,结构化程序的控制流图是稀疏的,并且可以以多种方式分解。在本文中,我们依赖于系列-并行-循环(SPL)分解,如~\cite{RegisterAllocation}所引入。我们的主要贡献是一个针对SPL图的PCSP通用算法,时间复杂度为$O(|G| \cdot |D|^6)$,其中$|G|$表示控制流图的大小。请注意,对于任何固定的域D,这会产生线性时间的解决方案。我们的算法可以看作是之前基于SPL的寄存器分配和LOSPRE方法的泛化和统一。此外,我们还提供了另一个经典PCSP任务,即最优银行选择的实验结果,实现了比之前最先进的运行时间快四倍的性能。
英文摘要:
In this work, we focus on the Partial Constraint Satisfaction Problem (PCSP) over control-flow graphs (CFGs) of programs. PCSP serves as a generalization of the well-known Constraint Satisfaction Problem (CSP). In the CSP framework, we define a set of variables, a set of constraints, and a finite domain $D$ that encompasses all possible values for each variable. The objective is to assign a value to each variable in such a way that all constraints are satisfied. In the graph variant of CSP, an underlying graph is considered and we have one variable corresponding to each vertex of the graph and one or several constraints corresponding to each edge. In PCSPs, we allow for certain constraints to be violated at a specified cost, aiming to find a solution that minimizes the total cost. Numerous classical compiler optimization tasks can be framed as PCSPs over control-flow graphs. Examples include Register Allocation, Lifetime-optimal Speculative Partial Redundancy Elimination (LOSPRE), and Optimal Placement of Bank Selection Instructions. On the other hand, it is well-known that control-flow graphs of structured programs are sparse and decomposable in a variety of ways. In this work, we rely on the Series-Parallel-Loop (SPL) decompositions as introduced by~\cite{RegisterAllocation}. Our main contribution is a general algorithm for PCSPs over SPL graphs with a time complexity of \(O(|G| \cdot |D|^6)\), where \(|G|\) represents the size of the control-flow graph. Note that for any fixed domain $D,$ this yields a linear-time solution. Our algorithm can be seen as a generalization and unification of previous SPL-based approaches for register allocation and LOSPRE. In addition, we provide experimental results over another classical PCSP task, i.e. Optimal Bank Selection, achieving runtimes four times better than the previous state of the art.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。