EigenCFA: accelerating flow analysis with GPUs

We describe, implement and benchmark EigenCFA, an algorithm for accelerating higher-order control-flow analysis (specifically, 0CFA) with a GPU. Ultimately, our program transformations, reductions and optimizations achieve a factor of 72 speedup over an optimized CPU implementation. We began our investigation with the view that GPUs accelerate high-arithmetic, data-parallel computations with a poor tolerance for branching. Taking that perspective to its limit, we reduced Shivers's abstract-interpretive 0CFA to an algorithm synthesized from linear-algebra operations. Central to this reduction were "abstract" Church encodings, and encodings of the syntax tree and abstract domains as vectors and matrices. A straightforward (dense-matrix) implementation of EigenCFA performed slower than a fast CPU implementation. Ultimately, sparse-matrix data structures and operations turned out to be the critical accelerants. Because control-flow graphs are sparse in practice (up to 96% empty), our control-flow matrices are also sparse, giving the sparse matrix operations an overwhelming space and speed advantage. We also achieved speedups by carefully permitting data races. The monotonicity of 0CFA makes it sound to perform analysis operations in parallel, possibly using stale or even partially-updated data.

[1]  John Cocke,et al.  A program data flow analysis procedure , 1976, CACM.

[2]  Barbara G. Ryder,et al.  Performing data flow analysis in parallel , 1990, Proceedings SUPERCOMPUTING '90.

[3]  Barbara G. Ryder,et al.  Region Analysis: A Parallel Elimination Method for Data Flow Analysis , 1995, IEEE Trans. Software Eng..

[4]  Rajiv Gupta,et al.  The combining DAG: a technique for parallel data flow analysis , 1992, Proceedings Sixth International Parallel Processing Symposium.

[5]  Gary A. Kildall,et al.  A unified approach to global program optimization , 1973, POPL.

[6]  Olin Shivers,et al.  Control-flow analysis of higher-order languages of taming lambda , 1991 .

[7]  Yannis Smaragdakis,et al.  Resolving and exploiting the k-CFA paradox: illuminating functional vs. object-oriented program analysis , 2010, PLDI '10.

[8]  Angelika Zobel Parallel Interval Analysis of Data Flow Equations , 1990, ICPP.

[9]  Olin Shivers,et al.  Control flow analysis in scheme , 1988, PLDI '88.

[10]  Harry G. Mairson,et al.  Deciding $k$CFA is complete for EXPTIME , 2008, ICFP 2008.

[11]  Barbara G. Ryder,et al.  Elimination algorithms for data flow analysis , 1986, CSUR.

[12]  Michael Garland,et al.  Implementing sparse matrix-vector multiplication on throughput-oriented processors , 2009, Proceedings of the Conference on High Performance Computing Networking, Storage and Analysis.

[13]  Patrick Cousot,et al.  Systematic design of program analysis frameworks , 1979, POPL.

[14]  Keshav Pingali,et al.  Parallel inclusion-based points-to analysis , 2010, OOPSLA.

[15]  Matthew S. Hecht,et al.  Flow Analysis of Computer Programs , 1977 .

[16]  Andrey Rybalchenko,et al.  Distributed and Predictable Software Model Checking , 2011, VMCAI.

[17]  Roberto Giacobazzi,et al.  A Fast Implementation of the Octagon Abstract Domain on Graphics Hardware , 2007, SAS.

[18]  Jens Palsberg,et al.  Closure analysis in constraint form , 1995, TOPL.

[19]  Neil D. Jones,et al.  Flow Analysis of Lambda Expressions (Preliminary Version) , 1981, ICALP.

[20]  Matthew Might,et al.  Improving flow analyses via ΓCFA: abstract garbage collection and counting , 2006, ICFP '06.

[21]  David Van Horn,et al.  Subcubic Control Flow Analysis Algorithms , 2009 .

[22]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[23]  Harry G. Mairson,et al.  Relating complexity and precision in control flow analysis , 2007, ICFP '07.

[24]  Barbara G. Ryder,et al.  An efficient hybrid algorithm for incremental data flow analysis , 1989, POPL '90.

[25]  Swarat Chaudhuri,et al.  Subcubic algorithms for recursive state machines , 2008, POPL '08.

[26]  K. D. Ikramov Sparse matrices , 2020, Krylov Subspace Methods with Application in Incompressible Fluid Flow Solvers.