583L7 - EECS 583 Class 7 Static Single Assignment Form...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
EECS 583 – Class 7 Static Single Assignment Form University of Michigan September 28, 2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
- 1 - Reading Material Today’s class » “Practical Improvements to the Construction and Destruction of Static Single Assignment Form,” P. Briggs, K. Cooper, T. Harvey, and L. Simpson, Software--Practice and Experience , 28(8), July 1998, pp. 859-891. Next class – Optimization » Compilers: Principles, Techniques, and Tools , A. Aho, R. Sethi, and J. Ullman, Addison-Wesley, 1988, 9.9, 10.2, 10.3, 10.7
Background image of page 2
- 2 - Last Class in 1 Slide OUT = Union(IN(succs)) IN = GEN + (OUT – KILL ) Liveness Reaching Definitions/DU/UD IN = Union(OUT(preds)) OUT = GEN + (IN – KILL ) Bottom-up dataflow Any path Keep track of variables/registers Uses of variables GEN Defs of variables KILL Top-down dataflow Any path Keep track of instruction IDs Defs of variables GEN Defs of variables KILL Available Definitions IN = Intersect(OUT(preds)) OUT = GEN + (IN – KILL ) Top-down dataflow All path Keep track of instruction IDs Defs of variables GEN Defs of variables KILL Available Expressions IN = Intersect(OUT(preds)) OUT = GEN + (IN – KILL ) Top-down dataflow All path Keep track of instruction IDs Expressions of variables GEN Defs of variables KILL
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
- 3 - From Last Time: Class Problem - Rdefs 1: r1 = 3 2: r2 = r3 3: r3 = r4 4: r1 = r1 + 1 5: r7 = r1 * r2 6: r4 = r4 + 1 7: r4 = r3 + r2 8: r8 = 8 9: r9 = r7 + r8 Compute reaching defs Calculate GEN/KILL for each BB Calculate IN/OUT for each BB IN = {} Gen = {1,2,3} Kill = {4} OUT = {1,2,3} IN = {1,2,3,8} {1,2,3,4,5,6,7,8} Gen = {4,5} Kill = {1} OUT = {2,3,4,5,8} {2,3,4,5,6,7,8} IN = {2,3,4,5,8} {2,3,4,5,6,7,8} Gen = {7} Kill = {6} OUT = {2,3,4,5,7,8} {2,3,4,5,7,8} IN = {2,3,4,5,6,7,8} Gen = {8} Kill = {} OUT = {2,3,4,5,6,7,8} IN = {2,3,4,5,6,7,8} Gen = {9} Kill = {} OUT = {2,3,4,5,6,7,8,9} IN = {2,3,4,5,8} {2,3,4,5,6,7,8} Gen = {6} Kill = {7} OUT = {2,3,4,5,6,8} {2,3,4,5,6,8} Remember, initial value for the OUT of BB5 is Gen(BB5) = 8. BB1 BB2 BB4 BB5 BB6 BB3
Background image of page 4
- 4 - From Last Time: Computation of Aexpr GEN/KILL Sets for each basic block in the procedure, X, do GEN(X) = 0 KILL(X) = 0 for each operation in sequential order in X, op, do K = 0 for each destination operand of op, dest, do K += {all ops which use dest} endfor if (op not in K) G = op else G = 0 GEN(X) = G + (GEN(X) – K) KILL(X) = K + (KILL(X) – G) endfor endfor We can also formulate the GEN/KILL slightly differently so you do not need to break up instructions like “r2 = r2 + 1”.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
- 5 - Class Problem - Aexprs Calculation 1: r1 = r6 * r9 2: r2 = r2 + 1 3: r5 = r3 * r4 4: r1 = r2 + 1 5: r3 = r3 * r4 6: r8 = r3 * 2 7: r7 = r3 * r4 8: r1 = r1 + 5 9: r7 = r1 - 6 10: r8 = r2 + 1 11: r1 = r3 * r4 12: r3 = r6 * r9
Background image of page 6
- 6 - Some Things to Think About Liveness and rdefs are basically the same thing » All dataflow is basically the same with a few parameters Meaning of gen/kill – src vs dest, variable vs operation
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/26/2011 for the course EECS 583 taught by Professor Flinn during the Fall '08 term at University of Michigan.

Page1 / 32

583L7 - EECS 583 Class 7 Static Single Assignment Form...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online