Data Flow Analysis
Introductory exposition (textbooks, tutorial papers, etc.) pertaining to computer science (68-01) Research exposition (monographs, survey articles) pertaining to computer science (68-02) Theory of compilers and interpreters (68N20) Theory of software (68N99) General topics in the theory of data (68P01) Specification and verification (program logics, model checking, etc.) (68Q60)
Data flow analysis is a classical technique that has been used to discover useful properties of programs. Among other applications, modern compilers make use of this technique to understand and validify a program, optimize code, and enable program execution. This book discusses the theory and practice of data flow analysis in the context of compiler optimization, although the general data flow equation model can be applied to other applications as well. One way to look at data computation is to find out how data changes via assignment to variables. The basic idea of data flow analysis as applied to a \textit{block} of statements is thus to discover the effect of that block on variables (local analysis) then relate all such effects throughout a program (global analysis). Such a relationship between local data flow information and global information within a block, and that among the blocks, is captured in this book via systems of \textit{data flow equations.} For example, for each block \(n,\) a basic equation characterizing the collection of the \textit{live variables,} i.e., those that may still be used after block \(n,\) is as follows: \[ In_n =(Out_n-Kill_n) \cup Gen_n,\quad \text{and} \] \[ Out_n = \begin{cases} BI & \text{if \(n\) is the last block of the program}\\ \bigcup_{s \in SUCC(n)} In_s & \text{otherwise} \end{cases} \] where \(In_n\) and \(Out_n\) refer to those in use before the execution of the first statement and those in use after the execution of the last statement of \(n\), respectively; \(Kill_n\) and \(Gen_n\) refer to those generated and made invalid during the execution of the statements within the block; \(SUCC(n)\) refers to a block that succeeds \(n\); and \(BI\) (Boundary Information) the liveness of variables at the end of the program. The book argues that data analysis of a program can be carried out by setting up, and then solving, such equations and goes through 10 chapters to show how this is to be done. After an introductory chapter covering various basic concepts through a simple example, this book proceeds in three parts: \textit{intra}procedural data flow analysis; \textit{inter}procedural data flow analysis; and a generic data flow analyzer implemented in GCC (GNU Compiler Collection). In Part~I, where the scope of the analysis is restricted to a single procedure, after spending a chapter on presenting and discussing various techniques to carry out the aforementioned local and global analysis as demonstrated in many telling examples, the authors capture the unifying theme and discuss the general data analysis framework in terms of the equations, its graph and lattice theory related properties, the complexity of such analysis and possible intermediate representations. Part~II is to deal with the much more complicated data analysis when multiple procedures are involved in a program. The basic function approach is to abstract the effect of a called procedure in terms of a context independent and parameterized summary flow function, and use such an abstraction to compute the synthesized data flow information for the whole program. In an alternative valued-based approach, when a procedural call is discovered, the flow information as inherited from the caller is propagated to the called procedure, whose body is examined, and at the end, the collected information is sent back to the calling procedure, where the examination of the caller is resumed. These two approaches are discussed in full details in two separate chapters. Finally, Part~III presents a general data analysis analyzer in GCC. The authors discuss all the specification and operation details, as well as its application to the simple example that they start the book with and a discussion of its analytical result. My overall impression is that this book on data flow analysis provides a very decent and quite balanced coverage of the topic from a formal perspective. It is well written and nicely organized, containing many examples which definitely help to clarify the rather technical content. All the chapters end with a summary and concluding remarks, as well as bibliographic notes, pointing to further readings. This book also comes with a live web page [available at \url{http://www.cse.iitb.ac.in/~uday/dfaBook-web/}] that contains slides with some additional material, an Errata section, updated on the same day when I checked it, and the analyzer software. This book includes an introduction to GCC, a rich list of references and an index. Considering the fact that there exist quite some special symbols/names used in this book, such as \(In_n, Out_n, BI,\) and some of them are not so easy to understand, a complete list of terminology, together with their definitions, will be definitely useful. I can't find any exercises, either in this book or in the associated Web Page, although this book is based on a course taught at IIT Bombay. It seems that at least two kinds of exercises can be assigned: one is to trace a block/program to come up with some program information, e.g., live and dead variables for the blocks, such as the one given in Example~2.3, which can then be used to verify the results as obtained from the analyzer; and the other being establishing and solving the data flow equations, at the heart of this book. As aforementioned, this book comes with many examples. It seems that most of them present end results straight without the process of how these results are obtained. It might be more helpful to the students to also include some of the derivation details in some of the examples.
- Advanced symbolic analysis for compilers. New techniques and algorithms for symbolic program analysis and optimization.
- PBDiff: Neural network based program-wide diffing method for binaries
- DataFAN: A practical approach to data flow analysis for Ada 95
- An approach of data-flow analysis based on exception propagation analysis
- Reasoning about program transformations. Imperative programming and flow of data
- scientific article; zbMATH DE number 1883605 (Why is no real title available?)
- Knowledge and local actions
- A matching logic foundation for Alk
- Efficient interprocedural data-flow analysis using treedepth and treewidth
- Context-sensitive analysis without calling-context
- Data-flow analyses as effects and graded monads
This page was built for publication: Data Flow Analysis
Report a bug (only for logged in users!)Click here to report a bug for this page (MaRDI item Q3618635)