1 / 18

380C

Last Time Interactions of scheduling and register usage. Today Interactions of scheduling and instruction level parallelism. 380C. Shape of Expressions. Proebsting & Fischer assume a fixed expression tree Hunt et al. reorganize commutative and associative operations in expression trees to

tex
Télécharger la présentation

380C

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. Last Time Interactions of scheduling and register usage Today Interactions of scheduling and instruction level parallelism 380C CS 380C

  2. Shape of Expressions • Proebsting & Fischer assume a fixed expression tree • Hunt et al. reorganize commutative and associative operations in expression trees to • Increase ILP • Decrease critical path length • Group constants

  3. Motivation • Long pipelines and fine grain parallel processors (e.g., SuperScalar RISC, VLIW & EDGE) benefit from instruction level parallelism. • Decreasing critical path length improves loop performance • Grouping constants improves constant propagation.

  4. Example • Let M denote intermediate values we need to preserve. • Let I denote associative operations whose intermediate values we do not need to preserve.

  5. Example • What should we do to balance this tree?

  6. Balancing M3

  7. Balancing M1

  8. Baer & Bovet: Balance Subtree Approach • Given a tree of associative and commutative operators, and other operators • Rearrange the tree to make it more balanced • Caveats • Preserve intermediate values in the expression tree that are used elsewhere • Preserve subtrees rooted by non-associative operations

  9. Problem - unbalanced • Although each preserved node has a balanced sub-tree, the whole tree isn’t very balanced. • Note that preserved nodes with many leaves can be closer to the root.

  10. Solution – Huffman Coding • Give constants weight 0 • Give other leaves weight 1 • Give interior nodes weight by summing their leaves • Put them all in a sorted worklist • Take two lowest weight nodes out of the worklist until the worklist is a singleton • Combine them in a subtree • Weigh this interior node by summing its leaves, insert it in the worklist • Weigh preserved nodes by summing subtrees • Guarantees optimally balanced tree

  11. After marking the weights

  12. Balancing according to HuffmanIs this better?

  13. Another Example

  14. Balanced

  15. After constant propagation

  16. Results • Mixed • Improves a few programs by a lot, but not a lot of programs on TRIPS simulator • Huffman minimizes the sum of the tree • Baer and Bovet minimize the length of the critical path • In practice, they often attain the same result for expression reduction • For software fanout trees, Huffman seems to tolerate unknown latencies through the program better than Hartley and Casavant, which minimizes the length of the critical path given non-unit weights

  17. Summary • Reorganize trees of commutative and associative operations. • Use Huffman coding to produce an overall balanced tree • Improves ILP • Decrease critical path length • Group constants

  18. Next Time • P. Briggs, Register Allocation via Graph Coloring, PhD dissertation, Rice University, April 1992, Chapters 1, 2, 3, 6, 7, 8 & 9 • Skim and/or cherry pick depending on your interests

More Related