1 / 12

Review for the Course

Review for the Course. Iterative Dataflow Analysis. Reaching definitions Live variables. Iterative Dataflow Analysis. Foundations of Data Flow Analysis . Correctness Equations will be satisfied when the program terminates. Is this the solution that we want?

robbin
Télécharger la présentation

Review for the Course

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. Review for the Course

  2. Iterative Dataflow Analysis • Reaching definitions • Live variables

  3. Iterative Dataflow Analysis

  4. Foundations of Data Flow Analysis • Correctness • Equations will be satisfied when the program terminates. Is this the solution that we want? • Precision: how good is the answer? • Is the answer ONLY a union of all possible execution paths? • Convergence: will the answer terminate? • Or, will there always be some nodes that change? • Speed: how fast is the convergence? • how many times will we visit each node?

  5. Solving Data Flow Problems • Semi-Lattice • Set of values, meet operator, top & bottom, finite descending chain • Transfer Functions • function of each basic block, monotone, distributive • FP ≤ MFP ≤ MOP ≤ Perfect-Solution • Algorithm • initialization step (entry/exit) • visit order: rPostOrder • depth of the graph

  6. Global CSE: Available Expressions • Domain: A bit vector, a bit for each lexically unique expression in the program • Forward or Backward problem? • Meet operator? • check commutative, idempotent, associative • Partial ordering • Lattice elements? • Top? Bottom? • Initialization for iterative algorithm

  7. Finding Natural loops • Find the dominator relations in a flow graph • Identify the back edges • Find the natural loop associated with the back edge

  8. Loop Invariant Code Motion • Finding loop-invariant computations • Check conditions for code motion

  9. Strength Reduction and Induction Variable Elimination • Strength Reduction Let A be an induction variable in a family of basic induction variable B (i.e., A = c1 × B + c2) • Create a new variable: A’ • Initialization in preheader: A’ = c1 × B + c2 • Track value of B: add after B = B + x: A’ = A’ + x × c1 • Replace assignment to A: A = A’ • Work also for non-trivial BIVs

  10. Register Allocation Modeled by coloring interference graph Spilling • A node whose degree < n can always be colored • Optimistic coloring Live range splitting Rematerialization Coalescing

  11. Instruction Scheduling Techniques Instruction scheduling is constrained by resource and dependenceconstraints Categories of instruction scheduling • Local, basic block scheduling List scheduling • Global, cross-block scheduling Speculation, join motion, unification, renaming, substitution • Software pipelining Modulo scheduling, enhanced pipeline scheduling

  12. Thank You!

More Related