From generic to specific: off-line optimization for a general constraint solver

A general constraint solver simplifies the implementation of program analyses because constraint generation can then be separated from constraint solving. In return, a general solver often needs to sacrifice performance for generality. We describe a strategy that given a set of constraints first performs off-line optimizations (performed before the execution of the solver) which enable a solver to find (potential) equivalences between analysis variables so as to reduce the problem space and thus improve performance. The idea is that different analyses use different subsets of constraints. As a result, a specific property may hold for the subsets and a specific optimization can be conducted on the constraints. To be concrete, we introduce two off-line algorithms and apply them on the constraints generated by Andersen's pointer analysis, or by a reaching definitions analysis, respectively. The experimental results show that these algorithms dramatically reduce the effort of solving the constraints, by detecting and unifying equivalent analysis variables. Furthermore, because these optimizations are conducted on constraints instead of analysis specifications, we can reuse them for different analyses and even automatically detect the off-line analyses to be used.

[1]  Chris Hankin,et al.  Efficient field-sensitive pointer analysis of C , 2007, TOPL.

[2]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

[3]  Alexander Aiken,et al.  Partial online cycle elimination in inclusion constraint graphs , 1998, PLDI.

[4]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[5]  Olivier Tardieu,et al.  Ultra-fast aliasing analysis using CLA: a million lines of C code in a second , 2001, PLDI '01.

[6]  Konstantinos Sagonas,et al.  XSB as an efficient deductive database engine , 1994, SIGMOD '94.

[7]  Fritz Henglein,et al.  Global tagging optimization by type inference , 1992, LFP '92.

[8]  Ben Hardekopf,et al.  The ant and the grasshopper: fast and accurate pointer analysis for millions of lines of code , 2007, PLDI '07.

[9]  Robert E. Tarjan,et al.  Data structures and network algorithms , 1983, CBMS-NSF regional conference series in applied mathematics.

[10]  Lars Ole Andersen,et al.  Program Analysis and Specialization for the C Programming Language , 2005 .

[11]  Monica S. Lam,et al.  Using Datalog with Binary Decision Diagrams for Program Analysis , 2005, APLAS.

[12]  David A. McAllester,et al.  Linear-time subtransitive control flow analysis , 1997, PLDI '97.

[13]  Bjarne Steensgaard,et al.  Points-to analysis in almost linear time , 1996, POPL '96.

[14]  Flemming Nielson,et al.  A Scalable Inclusion Constraint Solver Using Unification , 2007, LOPSTR.

[15]  Chris Hankin,et al.  Online Cycle Detection and Difference Propagation: Applications to Pointer Analysis , 2004, Software Quality Journal.

[16]  Manuvir Das,et al.  Unification-based pointer analysis with directional assignments , 2000, PLDI '00.

[17]  George C. Necula,et al.  CIL: Intermediate Language and Tools for Analysis and Transformation of C Programs , 2002, CC.

[18]  Susan Horwitz,et al.  The Effects of the Precision of Pointer Analysis , 1997, SAS.

[19]  Flemming Nielson,et al.  Experiments with Succinct Solvers , 2002 .

[20]  Flemming Nielson,et al.  A Succinct Solver for ALFP , 2002, Nord. J. Comput..

[21]  Henrik Pilegaard A feasibility Study: The Succinct Solver v2.0, XSB Prolog v2.6, and Flow-Logic Based Program Analysis for Carmel , 2003 .