Skip to main content
QUICK REVIEW

[论文解读] Optimal Dyck Reachability for Data-Dependence and Alias Analysis

Krishnendu Chatterjee, Bhavya Choudhary|arXiv (Cornell University)|Jan 1, 2017
Advanced Database Systems and Queries被引用 10
一句话总结

本文提出静态分析中Dyck可达性的最优算法,对有向图实现O(m + n·α(n))时间复杂度——优于先前的界限——并通过归约至布尔矩阵乘法证明其条件最优性。该方法在预处理后使上下文敏感的数据依赖分析实现线性客户端成本,实验结果表明在真实世界基准测试中显著提升了速度并减少了内存占用。

ABSTRACT

A fundamental algorithmic problem at the heart of static analysis is Dyck reachability. The input is a graphwhere the edges are labeled with different types of opening and closing parentheses, and the reachabilityinformation is computed via paths whose parentheses are properly matched. We present new results for Dyckreachability problems with applications to alias analysis and data-dependence analysis. Our main contributions,that include improved upper bounds as well as lower bounds that establish optimality guarantees, are asfollows:First, we consider Dyck reachability on bidirected graphs, which is the standard way of performing field-sensitive points-to analysis. Given a bidirected graph withnnodes andmedges, we present: (i) an algorithmwith worst-case running timeO(m+n·α(n)), whereα(n)is the inverse Ackermann function, improving thepreviously knownO(n2)time bound; (ii) a matching lower bound that shows that our algorithm is optimalwrt to worst-case complexity; and (iii) an optimal average-case upper bound ofO(m)time, improving thepreviously knownO(m·logn)bound.Second, we consider the problem of context-sensitive data-dependence analysis, where the task is to obtainanalysis summaries of library code in the presence of callbacks. Our algorithm preprocesses libraries in almostlinear time, after which the contribution of the library in the complexity of the client analysis is only linear,and only wrt the number of call sites.Third, we prove that combinatorial algorithms for Dyck reachability on general graphs with truly sub-cubic bounds cannot be obtained without obtaining sub-cubic combinatorial algorithms for Boolean MatrixMultiplication, which is a long-standing open problem. Thus we establish that the existing combinatorialalgorithms for Dyck reachability are (conditionally) optimal for general graphs. We also show that the samehardness holds for graphs of constant treewidth.Finally, we provide a prototype implementation of our algorithms for both alias analysis and data-dependenceanalysis. Our experimental evaluation demonstrates that the new algorithms significantly outperform allexisting methods on the two problems, over real-world benchmarks.

研究动机与目标

  • 解决静态程序分析中Dyck可达性这一基本挑战,其为别名分析和数据依赖分析的基础。
  • 改进有向图上Dyck可达性的最坏情况和平均情况时间复杂度,此类图模型字段敏感的指针分析。
  • 通过将Dyck可达性与布尔矩阵乘法关联,建立一般图上现有组合算法的条件最优性。
  • 通过库代码摘要实现高效的上下文敏感数据依赖分析,将客户端分析成本降至线性时间。
  • 通过在真实世界基准测试上的原型实现,展示所提算法的实际优越性。

提出的方法

  • 设计一种新型算法,用于有向图上的Dyck可达性,采用带路径压缩和按秩合并的并查集数据结构,实现O(m + n·α(n))的最坏情况时间复杂度。
  • 通过从3SUM问题的归约证明匹配的下界,表明O(m + n·α(n))的界限在渐近意义上是最优的。
  • 为数据依赖分析中的库代码引入近乎线性时间的预处理阶段,实现无论库大小如何,客户端分析成本均为线性时间。
  • 利用程序图的常数树宽特性,实现数据依赖分析的近乎线性时间复杂度。
  • 通过将Dyck可达性归约至布尔矩阵乘法,表明若无BMM领域的突破,无法获得真正亚立方时间的组合算法。
  • 使用原型实现并评估算法在真实世界基准测试上的表现,与TAL和CFL可达性方法进行对比。

实验结果

研究问题

  • RQ1有向图上的Dyck可达性能否在亚二次时间内求解,且该界限是否紧致?
  • RQ2是否可通过预处理库并摘要其行为,使上下文敏感的数据依赖分析变得高效?
  • RQ3能否使用组合算法实现一般图上Dyck可达性的真正亚立方时间复杂度?
  • RQ4所提算法在实践中是否优于现有方法,特别是在时间和内存使用方面?
  • RQ5该算法能否处理具有不同树宽的真实世界程序,包括在极端情况下树宽较高的情况?

主要发现

  • 所提有向图算法的时间复杂度为O(m + n·α(n)),优于先前的O(n²)界限,并与新下界匹配,证明其最优性。
  • 该算法实现了最优的平均情况时间复杂度O(m),优于先前的O(m·log n)界限。
  • 在数据依赖分析中,该算法可实现近乎线性时间的库预处理,使客户端分析成本在调用站点数量上保持线性。
  • 在串行基准测试中,该算法相比CFL可达性实现最高达630倍的加速,相比TAL可达性实现30倍加速,后者此前因内存不足而无法运行。
  • 内存使用大幅减少:该算法在串行基准测试中仅使用130 MB内存,相比CFL可达性减少33倍,相比TAL减少90倍以上。
  • 优势不仅限于高回调代码;该算法在非回调场景下也优于CFL和TAL,展现出广泛的适用性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。