[Paper Review] Optimal and Perfectly Parallel Algorithms for On-demand Data-flow Analysis
This paper presents optimal and perfectly parallel algorithms for on-demand interprocedural data-flow analysis in the IFDS framework by exploiting the low treewidth of program flow graphs. The approach achieves linear-time preprocessing and constant-time queries, with near-perfect parallelism, significantly outperforming prior methods in both preprocessing and query speed on real-world benchmarks.
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.
Motivation & Objective
- To address the high computational cost of exhaustive interprocedural data-flow analysis in large programs.
- To enable fast on-demand queries for program analysis by separating preprocessing and query phases.
- To exploit low treewidth in program flow graphs to design optimal and parallel algorithms.
- To achieve both time and space optimality for common data-flow analyses.
- To enable embarrassingly parallel query processing with near-optimal speedup.
Proposed method
- Leveraging the low treewidth of program flow graphs to design algorithms with optimal time and space complexity.
- Using tree decomposition to precompute and store analysis summaries during a lightweight preprocessing phase.
- Designing query algorithms that split work evenly across threads, enabling constant work per thread.
- Implementing a static analyzer based on the proposed algorithms for empirical evaluation.
- Using a combination of theoretical analysis and experiments on DaCapo benchmarks to validate performance.
- Applying word-level optimizations and parallelization techniques to achieve near-perfect parallelism in query execution.
Experimental results
Research questions
- RQ1Can on-demand IFDS analysis be made both time- and space-optimal using structural properties of flow graphs?
- RQ2Can the preprocessing phase be made lightweight while still enabling constant-time queries?
- RQ3Can the query phase be made embarrassingly parallel, with each thread performing only constant work?
- RQ4Does exploiting treewidth lead to significant practical performance improvements over existing methods?
- RQ5Can the proposed algorithms handle real-world Java programs with small treewidth effectively?
Key findings
- The proposed algorithm achieves preprocessing time complexity of O(n·|D|³), which is optimal and independent of procedure size.
- All queries are answered in O(1) time, matching the performance of heavyweight complete preprocessing.
- The parallel version achieves a 11.3× speedup on 12 threads, demonstrating near-perfect parallelism.
- The preprocessing phase completes within 5 minutes for all 110 benchmarks, while CPP timed out on 25% of instances.
- Treewidth of real-world programs was found to be small (max 9, min 1), confirming the practical relevance of the approach.
- The method outperforms all prior approaches in both preprocessing and query phases, especially on larger programs.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.