Interval Analysis Pass 1

Here is the CFG:

And here are the initial GEN and NOT-KILL sets for the CFG's edges (copies of the GEN and NOT-KILL sets of the edge's source node).

EDGE GEN NOT-KILL
1→2(w,1)(x,3)(x,4)(x,6)(y,2)(y,5)
1→4(w,1)(x,3)(x,4)(x,6)(y,2)(y,5)
2→3(y,2)(x,3)(x,4)(x,6)(w,1)
2→5(y,2)(x,3)(x,4)(x,6)(w,1)
3→5(x,3)(y,2)(y,5)(w,1)
4→1(x,4)(y,2)(y,5)(w,1)
5→6(y,5);(x,3)(x,4)(x,6)(w,1)
5→7(y,5);(x,3)(x,4)(x,6)(w,1)
6→5(x,6);(y,2)(y,5)(w,1)

Here is the CFG divided into intervals.

Here are the DEF and PRE sets for each node and each edge of each of the two intervals (compositions of the dataflow functions on acyclic paths through the interval).

Interval I1

NODE OR EDGE DEF PRE
1empty(x,3)(x,4)(x,6)(y,2)(y,5)(w,1)
1→2(w,1)(x,3)(x,4)(x,6)(y,2)(y,5)
1→4(w,1)(x,3)(x,4)(x,6)(y,2)(y,5)
2(w,1)(x,3)(x,4)(x,6)(y,2)(y,5)
2→3(y,2)(w,1)(x,3)(x,4)(x,6)
2→5(y,2)(w,1)(x,3)(x,4)(x,6)
3(y,2)(w,1)(x,3)(x,4)(x,6)
3→5(x,3)(y,2)(w,1)empty
4(w,1)(x,3)(x,4)(x,6)(y,2)(y,5)
4→1(x,4)(w,1)(y,2)(y,5)

Interval I2:

NODE OR EDGE DEF PRE
5empty(x,3)(x,4)(x,6)(y,2)(y,5)(w,1)
5→6(y,5)(x,3)(x,4)(x,6)(w,1)
5→7(y,5)(x,3)(x,4)(x,6)(w,1)
6(y,5)(x,3)(x,4)(x,6)(w,1)
6→5(x,6)(y,5)(w,1)

Here are the GEN, NOT-KILL, and R sets for the intervals.

GEN(I1, I2) (x,3)(x,4)(y,2)(w1)
NOT-KILL(I1, I2) (x,3)(x,4)(x,6)
R(head(I1)) (x,4)(w,1)
R(head(I2)) (x,6)(y,5)

Here is the next CFG.

This CFG has just one interval, and it has no backedge, so its R set is empty and we're done with Interval Analysis Pass 1 (we don't need to compute the DEF and PRE sets for its nodes and edges). If this CFG did have a backedge, we would need to compute the DEF and PRE sets since the R set is the union of the DEF sets on all backedges into the interval head.

Interval Analysis Pass 2

For the single-interval CFG (the one with two nodes, I1 and I2), the "before" fact for the whole interval is the initial dataflow fact, which is the empty set for Reaching Definitions.

Here are the "before" and "after" sets for this interval's nodes (I1 and I2):

NODE OR EDGE"before""after"
I1 (x,4)  
I1→I2   (x,3)(x,4)(y,2)(w,1)
I2 (x,3)(x,4)(y,2)(w,1)  

Now we can use the "before" set for I1 as the "before" fact for the whole I1 interval in the previous CFG (the original CFG divided into two intervals, I1 and I2), and we can use the "before" set for I2 as the "before" fact for the whole interval I2 in the same CFG. CFG.

Given these two "before" sets (plus the GEN, NOT-KILL, and R sets for this CFG), we can compute the "before" sets for all of the nodes of the original CFG and the "after" set for all edges, by visiting the nodes of I1 and of I2 in interval order.

Here are those sets for each interval.

Interval I1

NODE OR EDGE "before" "after"
1(x,4)(w,1) 
1→2 (x,4)(w,1)
1→4 (x,4)(w,1)
2(x,4)(w,1)) 
2→3 (x,4)(y,2)(w,1)
2→5 (x,4)(y,2)(w,1)
3(x,4)(y,2)(w,1)) 
3→5 (x,3)(y,2)(w,1)
4(x,4)(w,1)) 
4→1 (x,4)(w,1)

Interval I2

NODE OR EDGE "before" "after"
5(x,3)(x,4)(x,6)(y,2)(w,1) 
5→6 (x,3)(x,4)(x,6)(y,5)(w,1)
5→7 (x,3)(x,4)(x,6)(y,5)(w,1)
6(x,3)(x,4)(x,6)(y,5)(w,1))