Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must |
Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must | Available expressions |
Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must | Available expressions | Anticipated Expressions |
1: x = input;
2: a = x - 1;
3: b = x - 2;
4: while (x > 0) { -- Optimize -->
5: output a * b - x;
6: x = x - 1;
7: }
8: output a * b;
1: x = input; x = input;
2: a = x - 1; a = x - 1;
3: b = x - 2; b = x - 2; t = a * b;
4: while (x > 0) { -- Optimize --> while (x > 0) {
5: output a * b - x; output t - x;
6: x = x - 1; x = x - 1;
7: } }
8: output a * b; output t;
1: x = input; x = input;
2: a = x - 1; a = x - 1;
3: b = x - 2; b = x - 2; t = a * b;
4: while (x > 0) { -- Optimize --> while (x > 0) {
5: output a * b - x; output t - x;
6: x = x - 1; x = x - 1;
7: } }
8: output a * b; output t;
a * b
is anticipated to be used in the future.
a * b
is an anticipated expression (or a very busy expression) at the exit point of line 3.Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must | Available expressions | Anticipated Expressions |
Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must | Available expressions | Anticipated Expressions |
Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must | Available expressions | Anticipated Expressions |
Forward | Backward | |
---|---|---|
may | Reaching Definitions | Liveness |
must | Available expressions | Anticipated Expressions |
Ingredients of Data-flow analysis
Does a fixed-point algorithm always converge?
... if (buf[i] > x) ...
x
... if (buf[i] > x) ...
x