lecture-8 Program Representations (continued)

lecture-8 Program Representations (continued) - • Option...

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

View Full Document Right Arrow Icon
1 From last class: CSE • Want to compute when an expression is available in a var • Domain: Flow functions X := Y op Z in out F X := Y op Z (in) = X := Y in out F X := Y (in) = Flow functions X := Y op Z in out F X := Y op Z (in) = in – { X * } – { * ... X . .. } ± { X Y op Z | X Y ² X Z} X := Y in out F X := Y (in) = in – { X * } – { * ... X . .. } ± { X E | Y E ³ in } Example Problems • Available expressions overly sensitive to name choices, operand orderings, renamings, assignments • Use SSA: distinct values have distinct names • Do copy prop before running available exprs • Adopt canonical form for commutative ops Example in SSA X := Y op Z in out F X := Y op Z (in) = X := φ (Y,Z) in 0 out F X := Y (in) = in 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Example in SSA X := Y op Z in out F X := Y op Z (in) = in { X ± Y op Z } X := φ (Y,Z) in 0 out F X := Y (in) = in { X ± E | Y ± E ² in 0 ³ Z ± E ² in 1 } in 1 Example in SSA Example in SSA What about pointers? What about pointers? • Option 1: don’t use SSA for point-to memory
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Option 2: insert copies between SSA vars and real vars Loop-invariant code motion 3 Example Detecting loop invariants Computing loop invariants Example using def/use chains Example using def/use chains Loop invariant detection using SSA 4 Example using SSA Example using SSA and preheader Code motion Example Lesson from example: domination restriction Domination restriction in for loops 5 Domination restriction in for loops Avoiding domination restriction Another example Data dependence restriction Avoiding data restriction More advanced control representations 6 More advanced control representations The above is Click’s solution (PLDI 95) The above is Click’s solution (PLDI 95) More advanced control representations • The Click algorithm shows the need to distinguish “dependance regions” • Next lecture we’ll see how to do this....
View Full Document

This note was uploaded on 02/19/2008 for the course CSE 231 taught by Professor Lerner during the Fall '06 term at UCSD.

Page1 / 6

lecture-8 Program Representations (continued) - • Option...

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

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