Optimization of the Context-Free Language Reachability Matrix-Based Algorithm (2401.11029v1)
Abstract: Various static analysis problems are reformulated as instances of the Context-Free Language Reachability (CFL-r) problem. One promising way to make solving CFL-r more practical for large-scale interprocedural graphs is to reduce CFL-r to linear algebra operations on sparse matrices, as they are efficiently executed on modern hardware. In this work, we present five optimizations for a matrix-based CFL-r algorithm that utilize the specific properties of both the underlying semiring and the widely-used linear algebra library SuiteSparse:GraphBlas. Our experimental results show that these optimizations result in orders of magnitude speedup, with the optimized matrix-based CFL-r algorithm consistently outperforming state-of-the-art CFL-r solvers across four considered static analyses.
- Rustam Azimov. 2022. Context-Free Path Querying Using Linear Algebra. Ph. D. Dissertation. St. Petersburg State University. https://disser.spbu.ru/files/2022/disser_azimov.pdf
- Rustam Azimov and Semyon Grigorev. 2018. Context-Free Path Querying by Matrix Multiplication. In Proceedings of the 1st ACM SIGMOD Joint International Workshop on Graph Data Management Experiences & Systems (GRADES) and Network Data Analytics (NDA) (Houston, Texas) (GRADES-NDA ’18). Association for Computing Machinery, New York, NY, USA, Article 5, 10 pages. https://doi.org/10.1145/3210259.3210264
- Timothy A. Davis. 2023. Algorithm 1037: SuiteSparse:GraphBLAS: Parallel Graph Algorithms in the Language of Sparse Linear Algebra. ACM Trans. Math. Softw. 49, 3, Article 28 (sep 2023), 30 pages. https://doi.org/10.1145/3577195
- Giga-Scale Exhaustive Points-to Analysis for Java in under a Minute. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (Pittsburgh, PA, USA) (OOPSLA 2015). Association for Computing Machinery, New York, NY, USA, 535–551. https://doi.org/10.1145/2814270.2814307
- A Systematic Survey of General Sparse Matrix-Matrix Multiplication. ACM Comput. Surv. 55, 12, Article 244 (mar 2023), 36 pages. https://doi.org/10.1145/3571157
- Taming Transitive Redundancy for Context-Free Language Reachability. Proc. ACM Program. Lang. 6, OOPSLA2, Article 180 (oct 2022), 27 pages. https://doi.org/10.1145/3563343
- Efficient Evaluation of Context-Free Path Queries for Graph Databases. In Proceedings of the 33rd Annual ACM Symposium on Applied Computing (Pau, France) (SAC ’18). Association for Computing Machinery, New York, NY, USA, 1230–1237. https://doi.org/10.1145/3167132.3167265
- Context-Free Path Querying by Kronecker Product. Springer-Verlag, Berlin, Heidelberg, 49–59. https://doi.org/10.1007/978-3-030-54832-2_6
- Thomas Reps. 2000. Undecidability of Context-Sensitive Data-Dependence Analysis. ACM Trans. Program. Lang. Syst. 22, 1 (jan 2000), 162–186. https://doi.org/10.1145/345099.345137
- Precise Interprocedural Dataflow Analysis via Graph Reachability. In Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (San Francisco, California, USA) (POPL ’95). Association for Computing Machinery, New York, NY, USA, 49–61. https://doi.org/10.1145/199448.199462
- Atanas Rountev and Satish Chandra. 2000. Off-Line Variable Substitution for Scaling Points-to Analysis. In Proceedings of the ACM SIGPLAN 2000 Conference on Programming Language Design and Implementation (Vancouver, British Columbia, Canada) (PLDI ’00). Association for Computing Machinery, New York, NY, USA, 47–56. https://doi.org/10.1145/349299.349310
- Context-, Flow-, and Field-Sensitive Data-Flow Analysis Using Synchronized Pushdown Systems. Proc. ACM Program. Lang. 3, POPL, Article 48 (jan 2019), 29 pages. https://doi.org/10.1145/3290361
- Detecting Memory Leaks Statically with Full-Sparse Value-Flow Analysis. IEEE Transactions on Software Engineering 40, 2 (2014), 107–122. https://doi.org/10.1109/TSE.2014.2302311
- Robert Tarjan. 1971. Depth-First Search and Linear Graph Algorithms. In Proceedings of the 12th Annual Symposium on Switching and Automata Theory (Swat 1971) (SWAT ’71). IEEE Computer Society, USA, 114–121. https://doi.org/10.1109/SWAT.1971.10
- Leslie G. Valiant. 1975. General context-free recognition in less than cubic time. J. Comput. System Sci. 10, 2 (1975), 308–315. https://doi.org/10.1016/S0022-0000(75)80046-8
- Graspan: A Single-Machine Disk-Based Graph System for Interprocedural Static Analyses of Large-Scale Systems Code. SIGPLAN Not. 52, 4 (apr 2017), 389–404. https://doi.org/10.1145/3093336.3037744
- OrdinalFix: Fixing Compilation Errors via Shortest-Path CFL Reachability. arXiv:2309.06771 [cs.SE]
- Xin Zheng and Radu Rugina. 2008. Demand-Driven Alias Analysis for C. SIGPLAN Not. 43, 1 (jan 2008), 197–208. https://doi.org/10.1145/1328897.1328464