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

面向可扩展的过程间数据流分析的参数化算法

Parameterized Algorithms for Scalable Interprocedural Data-flow Analysis

Ahmed Khaled Zaher

AI总结:

本文针对按需过程间数据流分析的可扩展性问题,首次同时利用控制流图树宽和调用图树深进行参数化,提出线性预处理、常数时间查询的算法,显著优于经典 IFDS 方法。

摘要:

数据流分析是一种通用技术,用于计算程序不同位置上的感兴趣信息,并被视为静态分析的基石。在本论文中,我们考虑由标准 IFDS 框架形式化的过程间数据流分析,该框架可以表达许多广泛使用的静态分析,如到达定值、活跃变量和空指针分析。我们关注已被充分研究的按需设置,其中查询以流的形式逐个到达,并且每个查询应尽可能快地得到回答。虽然经典的 IFDS 算法为该问题提供了多项式时间的解决方案,但它在实践中不具备可扩展性。具体而言,它要么需要二次时间的预处理阶段,要么每个查询需要线性时间,这两者对于拥有数十万行代码的现代大型代码库来说都是不可行的。先前的工作已经表明,通过程序控制流图的树宽对该问题进行参数化是很有前景的,并且可以带来显著的效率提升。遗憾的是,这些结果仅适用于受限的同一上下文查询这一特殊情况。在本工作中,我们针对查询不一定是同一上下文的按需 IFDS 一般情况取得了显著的加速。这是通过利用一个新的图稀疏性参数,即程序调用图的树深来实现的。我们的方法是第一个同时利用控制流图和调用图的稀疏性,并以树宽和树深两者进行参数化的方法。我们获得了一个具有线性预处理阶段的算法,该算法可以在相对于输入大小的常数时间内回答每个查询。最后,我们展示了实验结果,证明我们的方法显著优于经典 IFDS 及其按需变体。

英文摘要:

Data-flow analysis is a general technique used to compute information of interest at different points of a program and is considered to be a cornerstone of static analysis. In this thesis, we consider interprocedural data-flow analysis as formalized by the standard IFDS framework, which can express many widely-used static analyses such as reaching definitions, live variables, and null-pointer. We focus on the well-studied on-demand setting in which queries arrive one-by-one in a stream and each query should be answered as fast as possible. While the classical IFDS algorithm provides a polynomial-time solution to this problem, it is not scalable in practice. Specifically, it either requires a quadratic-time preprocessing phase or takes linear time per query, both of which are untenable for modern huge codebases with hundreds of thousands of lines. Previous works have already shown that parameterizing the problem by the treewidth of the program's control-flow graph is promising and can lead to significant gains in efficiency. Unfortunately, these results were only applicable to the limited special case of same-context queries. In this work, we obtain significant speedups for the general case of on-demand IFDS with queries that are not necessarily same-context. This is achieved by exploiting a new graph sparsity parameter, namely the treedepth of the program's call graph. Our approach is the first to exploit the sparsity of control-flow graphs and call graphs at the same time and parameterize by both treewidth and treedepth. We obtain an algorithm with a linear preprocessing phase that can answer each query in constant time with respect to the input size. Finally, we show experimental results demonstrating that our approach significantly outperforms the classical IFDS and its on-demand variant.

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

↑