L5 Flashcards
dataflow analysis
reasoning about flow of data in program
different kinds of dataflow analysis
constants, variables, expressions
what do dataflow analysis used in
bug-finding tools and compilers
what is a control-flow graph?
a graph that summarizes the flow of control in all possible runs of the program
what does each node represent?
a unique primitive statement
what does each edge represent?
denotes immediate possible successor
can we achieve soundness, completeness, and termination?
no
what does dataflow analysis sacrifice?
completeness
How does dataflow analysis sacrifice completeness?
abstract away control-flow condition with non-deterministic choice
what non-deterministic choice does dataflow analysis use?
assume a condition can be evaluated to true or false. It considers path that is not possible in the actual run, thus incomplete
applications of dataflow analysis
reaching definition analysis, very busy expression analysis, available expression analysis, and live variable analysis.
reaching definition analysis
find usages of uninitialized variables
very busy expression analysis
reduce code size (use in pacemakers)
available expression analysis
use by the compiler to avoid recomputing expressions. Start with all available expression, and cross each out whenever it changes.
live variable analysis
use by the compiler to efficiently allocate registers to program variables