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.


翻译:本文聚焦于程序控制流图(CFG)上的部分约束满足问题(PCSP)。PCSP是经典约束满足问题(CSP)的推广形式。在CSP框架中,我们定义一组变量、一组约束以及包含所有变量可能取值的有限域$D$,目标是为每个变量赋值使得所有约束均被满足。在图形式的CSP中,考虑基础图结构,图中每个顶点对应一个变量,每条边对应一个或多个约束。在PCSP中,我们允许以特定代价违反部分约束,旨在寻找使总代价最小化的解。大量经典编译器优化任务可建模为控制流图上的PCSP问题,例如寄存器分配、生命周期最优的投机性部分冗余消除(LOSPRE)以及存储体选择指令的最优放置。另一方面,结构化程序的控制流图具有稀疏性且可通过多种方式分解。本研究基于~\cite{RegisterAllocation}提出的串并环(SPL)分解方法,主要贡献是提出针对SPL图PCSP的通用算法,其时间复杂度为\(O(|G| \cdot |D|^6)\),其中\(|G|\)表示控制流图的规模。需注意对于任意固定域$D$,该算法具有线性时间复杂度。本算法可视为先前基于SPL的寄存器分配与LOSPRE方法的推广与统一。此外,我们在另一经典PCSP任务——最优存储体选择上进行了实验验证,其运行速度较现有最优方法提升四倍。

0
下载
关闭预览

相关内容

【阿姆斯特丹博士论文】带约束学习的优化算法
专知会员服务
19+阅读 · 2025年4月4日
【ICML2022】可达性约束强化学习
专知会员服务
23+阅读 · 2022年5月18日
【开放书】《矩阵流形优化算法》,241页pdf
专知会员服务
96+阅读 · 2021年7月3日
综述:军事应用中使用的一些重要算法
专知
13+阅读 · 2022年7月3日
最新《图嵌入组合优化》综述论文,40页pdf
【APC】先进过程控制系统(APC: Advanced Process Control)
产业智能官
69+阅读 · 2020年7月12日
面试题:请简要介绍下tensorflow的计算图
七月在线实验室
14+阅读 · 2019年6月10日
<好书推荐> -《Pro Deep Learning with TensorFlow》分享
深度学习与NLP
12+阅读 · 2018年9月13日
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月15日
VIP会员
最新内容
2025年大语言模型进展报告
专知会员服务
1+阅读 · 30分钟前
多智能体协作机制
专知会员服务
0+阅读 · 34分钟前
非对称优势:美海军开发低成本反无人机技术
专知会员服务
4+阅读 · 今天4:39
《美战争部小企业创新研究(SBIR)计划》
专知会员服务
5+阅读 · 今天2:48
《军事模拟:将军事条令与目标融入AI智能体》
专知会员服务
8+阅读 · 今天2:43
【NTU博士论文】3D人体动作生成
专知会员服务
6+阅读 · 4月24日
以色列军事技术对美国军力发展的持续性赋能
专知会员服务
8+阅读 · 4月24日
《深度强化学习在兵棋推演中的应用》40页报告
专知会员服务
13+阅读 · 4月24日
《多域作战面临复杂现实》
专知会员服务
9+阅读 · 4月24日
《印度的多域作战:条令与能力发展》报告
专知会员服务
4+阅读 · 4月24日
相关VIP内容
【阿姆斯特丹博士论文】带约束学习的优化算法
专知会员服务
19+阅读 · 2025年4月4日
【ICML2022】可达性约束强化学习
专知会员服务
23+阅读 · 2022年5月18日
【开放书】《矩阵流形优化算法》,241页pdf
专知会员服务
96+阅读 · 2021年7月3日
相关基金
国家自然科学基金
2+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员