Changes

Jump to: navigation, search

Abstract Interpretation

66 bytes added, 21:23, 15 May 2008
Introduction
We're going to explain abstract interpretation using an example analysis problem called ''constant propagation''. The goal is to discover at each point in the function whether any of the variables used there have a constant value, i.e., the variable has the same value no matter what inputs are provided and no matter what code path was followed. This analysis is used by compilers for the constant propagation optimization, which means replacing constant variables with a literal value. (This may save a load of the variable, and it also removes a use of the variable, which can enable other optimizations.)
Here is an example C++ function:we want to analyze, with some comments showing constant variables.
int foo(int a, int b) {
313
edits

Navigation menu