s s - princeton university computer science · each definition modified to define brand-new...

13
1 Topic 10: Static Single Assignment COS 320 Compiling Techniques Princeton University Spring 2015 Prof. David August Def-Use Chains, Use-Def Chains Use-Def Chains, Def-Use Chains

Upload: vannguyet

Post on 11-May-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

1

Topic 10: Static Single Assignment

COS 320

Compiling Techniques

Princeton University Spring 2015

Prof. David August

Def-Use Chains, Use-Def Chains

Use-Def Chains, Def-Use Chains

Page 2: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

Static Single Assignment

Why SSA?

Conversion to SSA Code

Page 3: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

Conversion to SSA Form

Conversion to SSA Form

Conversion to SSA Form

Page 4: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

Conversion to SSA Form

Conversion to SSA Form

Dominance Frontier

Page 5: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

Dominance Frontier

Dominance Frontier Computation

SSA Example

Page 6: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

Dominator Analysis

SSA Example

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

SSA Example

Page 7: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Example

SSA Example

Static Single Assignment

Page 8: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Dominance Property

SSA Dead Code Elimination

SSA Dead Code Elimination

Page 9: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Simple Constant Propagation

SSA Simple Constant Propagation

The image cannot be displayed. Your computer may not have enough memory to open the image, or the image may have been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may have to delete the image and then insert it again.

SSA Conditional Constant Propagation

Page 10: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Conditional Constant Propagation

SSA Conditional Constant Propagation

SSA Conditional Constant Propagation

Page 11: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Conditional Constant Propagation

SSA Conditional Constant Propagation

SSA Conditional Constant Propagation Example

Page 12: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Conditional Constant Propagation Example

SSA Conditional Constant Propagation Example

SSA Conditional Constant Propagation Example

Page 13: s s - Princeton University Computer Science · Each definition modified to define brand-new register, ... Solve path-convergence ... SSA form make certain optimizations quick and

SSA Conditional Constant Propagation Example