1 / 24

Course project presentations

Learn about analyzing and moving invariant computations in loops through code hoisting and sinking. Explore strategies to avoid domination and data dependence restrictions. Dive into control dependencies and Control Dependence Graphs (CDG).

chenoweth
Download Presentation

Course project presentations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Course project presentations • No midterm project presentation • Instead of classes, next week I’ll meet with each group individually, 30 mins each • Two time slots: Tu-Th, 12:30 – 5:30

  2. From last time: Loop-invariant code motion • Two steps: analysis and transformations • Step1: find invariant computations in loop • invariant: computes same result each time evaluated • Step 2: move them outside loop • to top if used within loop: code hoisting • to bottom if used after loop: code sinking

  3. Code motion

  4. Example

  5. Lesson from example: domination restriction

  6. Domination restriction in for loops

  7. Domination restriction in for loops

  8. Avoiding domination restriction

  9. Another example

  10. Data dependence restriction

  11. Avoiding data restriction

  12. Summary of Data dependencies • We’ve seen SSA, a way to encode data dependencies better than just def/use chains • makes CSE easier • makes loop invariant detection easier • makes code motion easier • Now we move on to looking at how to encode control dependencies

  13. Control Dependencies • A node (basic block) Y is control-dependent on another X iff X determines whether Y executes • there exists a path from X to Y s.t. every node in the path other than X and Y is post-dominated by Y • X is not post-dominated by Y

  14. Control Dependencies • A node (basic block) Y is control-dependent on another X iff X determines whether Y executes • there exists a path from X to Y s.t. every node in the path other than X and Y is post-dominated by Y • X is not post-dominated by Y

  15. Example

  16. Example

  17. Control Dependence Graph • Control dependence graph: Y descendent of X iff Y is control dependent on X • label each child edge with required condition • group all children with same condition under region node • Program dependence graph: super-impose dataflow graph (in SSA form or not) on top of the control dependence graph

  18. Example

  19. Example

  20. Another example

  21. Another example

  22. Another example

  23. Summary of Control Depence Graph • More flexible way of representing control-depencies than CFG (less constraining) • Makes code motion a local transformation • However, much harder to convert back to an executable form

  24. Course summary so far • Dataflow analysis • flow functions, lattice theoretic framework, optimistic iterative analysis, precision, MOP • Advanced Program Representations • SSA, CDG, PDG • Along the way, several analyses and opts • reaching defns, const prop & folding, available exprs & CSE, liveness & DAE, loop invariant code motion • Next: dealing with procedures

More Related