# 07 - Control Flow Analysis Computing Static Single...

This preview shows pages 1–5. Sign up to view the full content.

Control Flow Analysis Last Time Constant propagation Dominator relationships Today Static Single Assignment (SSA) - a sparse program representation for data Fow Dominance ±rontier CS 380C Lecture 7 1 Static Single Assignment Computing Static Single Assignment (SSA) Form Overview What is SSA? Advantages of SSA over use-def chains “±lavors” of SSA Dominance frontier Control dependence Inserting φ -nodes Renaming the variables Translating out of SSA form R. Cytron, J. ±errante, B. K. Rosen, M. N. Wegman, and ±. K. Zadeck, “E²ciently Computing Static Single Assignment ±orm and the Control Dependence Graph”, ACM TOPLAS 13(4), October, 1991, pp. 451–490. CS 380C Lecture 7 2 Static Single Assignment

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

View Full Document
What is SSA? Each assignment to a variable is given a unique name All of the uses reached by that assignment are renamed Easy for straight-line code V 4V 0 4 V+5 V 0 +5 V 6V 1 6 V+7 V 1 +7 What about control Fow? = φ -nodes CS 380C Lecture 7 3 Static Single Assignment What is SSA? ± ± ± ± ± ± ± ± ± ± ±² ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³´ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³´ ± ± ± ± ± ± ± ± ± ± ±² if (. . . ) B 1 X 5 B 2 X 3 B 3 Y X B 4 ± ± ± ± ± ± ± ± ± ± ±² ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³´ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³ ³´ ± ± ± ± ± ± ± ± ± ± ±² if (. . . ) B 1 X 0 5 B 2 X 1 3 B 3 X 2 φ (X 0 ,X 1 ) Y X 2 B 4 CS 380C Lecture 7 4 Static Single Assignment
What is SSA? I 1 B 1 I I+1 B 2 ± ± ± I 0 1 B 1 I 1 φ (I 2 ,I 0 ) I 2 I 1 +1 B 2 ± ± ± CS 380C Lecture 7 5 Static Single Assignment Advantages of SSA over use-def chains More compact representation Easier to update? Each USE has only one defnition Defnitions are explicit merging oF values φ -node merge together multiple defnitions defnitions may reach multiple φ -node CS 380C Lecture 7 6 Static Single Assignment

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

View Full Document
“Flavors” of SSA Where do we place φ -nodes?
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 03/09/2012 for the course CS 380 taught by Professor Shmat during the Fall '08 term at University of Texas at Austin.

### Page1 / 11

07 - Control Flow Analysis Computing Static Single...

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

View Full Document
Ask a homework question - tutors are online