Data-flow analysis

A data flow analysis is a static code analysis of a computer program that examines, between which parts of a program, data will be passed and what dependencies resulting therefrom. Objectives of such analyzes are code optimizations in terms of execution time ( by deleting unnecessary code, restructuring or parallelization ) and the memory usage.

Data flow analysis can be divided into the following types:

  • Forward analyzes in which the program code with the help of control flow graph is examined and
  • Reverse analyzes in which the program code is analyzed using the reverse control flow graph.

Basic principle

Data flow analysis mostly work on the control flow graph whose nodes form the so-called blocks, some also on the dominator tree. These blocks comprise one or more instructions. Examine data flow analyzes, such as change data through a block. Contains a block, for example, the code x: = 5, then the data of the program change so that the variable contains x after passing through this block, the value 5, regardless of what or whether it has previously contained a value.

It also examines how data varies between the blocks. In the simplest case, they are simply passed on. However, several flow control flows (respectively edges of the control flow graph ) together (eg in loops), the information is either summarized or cut from all previous blocks. It differentiates between analyzes in must- ( at intersections ) and may- analyzes ( when combined quantities).

219571
de