Skip to main content
QUICK REVIEW

[论文解读] Optimal and Perfectly Parallel Algorithms for On-demand Data-flow Analysis

Krishnendu Chatterjee, Amir Kafshdar Goharshady|arXiv (Cornell University)|Jan 29, 2020
Advanced Data Storage Technologies参考文献 84被引用 14
一句话总结

本论文通过利用程序流图的低树宽特性,提出了在IFDS框架下用于按需过程间数据流分析的最优且完全并行的算法。该方法实现了线性时间预处理和常数时间查询,具备近乎完美的并行性,在真实世界基准测试中,其预处理和查询速度显著优于以往方法。

ABSTRACT

Interprocedural data-flow analyses form an expressive and useful paradigm of numerous static analysis applications, such as live variables analysis, alias analysis and null pointers analysis. The most widely-used framework for interprocedural data-flow analysis is IFDS, which encompasses distributive data-flow functions over a finite domain. On-demand data-flow analyses restrict the focus of the analysis on specific program locations and data facts. This setting provides a natural split between (i) an offline (or preprocessing) phase, where the program is partially analyzed and analysis summaries are created, and (ii) an online (or query) phase, where analysis queries arrive on demand and the summaries are used to speed up answering queries. In this work, we consider on-demand IFDS analyses where the queries concern program locations of the same procedure (aka same-context queries). We exploit the fact that flow graphs of programs have low treewidth to develop faster algorithms that are space and time optimal for many common data-flow analyses, in both the preprocessing and the query phase. We also use treewidth to develop query solutions that are embarrassingly parallelizable, i.e. the total work for answering each query is split to a number of threads such that each thread performs only a constant amount of work. Finally, we implement a static analyzer based on our algorithms, and perform a series of on-demand analysis experiments on standard benchmarks. Our experimental results show a drastic speed-up of the queries after only a lightweight preprocessing phase, which significantly outperforms existing techniques.

研究动机与目标

  • 解决大型程序中完整过程间数据流分析带来的高计算开销问题。
  • 通过分离预处理和查询阶段,实现程序分析的快速按需查询。
  • 利用程序流图中的低树宽特性,设计最优且并行的算法。
  • 实现常见数据流分析的时间和空间最优性。
  • 实现几乎完美的并行查询处理,达到近似最优加速比。

提出的方法

  • 利用程序流图的低树宽特性,设计时间与空间复杂度最优的算法。
  • 使用树分解在轻量级预处理阶段预计算并存储分析摘要。
  • 设计查询算法,使工作在各线程间均匀分配,确保每线程仅执行常数工作量。
  • 基于所提算法实现静态分析器,用于实验评估。
  • 结合理论分析与DaCapo基准测试的实验,验证性能表现。
  • 应用字级优化与并行化技术,实现在查询执行中近乎完美的并行性。

实验结果

研究问题

  • RQ1能否利用流图的结构特性,使按需IFDS分析在时间和空间上均达到最优?
  • RQ2能否在保证常数时间查询的前提下,使预处理阶段保持轻量化?
  • RQ3能否使查询阶段实现极度并行化,使每个线程仅执行常数工作量?
  • RQ4利用树宽是否能带来相较于现有方法的显著实际性能提升?
  • RQ5所提算法能否有效处理具有小树宽的实际Java程序?

主要发现

  • 所提算法的预处理时间复杂度为O(n·|D|³),达到最优且与过程规模无关。
  • 所有查询均在O(1)时间内完成,性能与重型完整预处理方法相当。
  • 并行版本在12个线程下实现11.3倍加速,表现出近乎完美的并行性。
  • 所有110个基准测试的预处理阶段均于5分钟内完成,而CPP在25%的实例中超时。
  • 实际程序的树宽较小(最大为9,最小为1),证实了该方法的实际适用性。
  • 该方法在预处理和查询阶段均优于所有先前方法,尤其在大型程序上表现更优。

更好的研究,从现在开始

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

无需绑定信用卡

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