583L8 - EECS 583 Class 8 Classic Optimization University of...

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

View Full Document Right Arrow Icon
EECS 583 – Class 8 Classic Optimization University of Michigan October 3, 2011
Background image of page 1

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

View Full DocumentRight Arrow Icon
- 1 - Announcements & Reading Material Homework 2 » Extend LLVM LICM optimization to perform speculative LICM » Due Friday, Nov 21, midnight (3 wks!) » This homework is significantly harder than HW 1 » Best time on performance benchmarks wins prize Today‟s class » Compilers: Principles, Techniques, and Tools , A. Aho, R. Sethi, and J. Ullman, Addison-Wesley, 1988, 9.9, 10.2, 10.3, 10.7 Material for Wednesday » “Compiler Code Transformations for Superscalar-Based High- Performance Systems,” Scott Mahlke, William Chen, John Gyllenhaal, Wen-mei Hwu, Pohua Chang, and Tokuzo Kiyohara, Proceedings of Supercomputing '92 , Nov. 1992, pp. 808-817
Background image of page 2
- 2 - From Last Time: Improved Class Problem c = b + a b = a + 1 a = b * c b = c - a a = a - c c = b * c a = b = c = BB0 BB1 BB2 BB3 BB4 BB5 Rename the variables so this code is in SSA form Step 1: Dominator Tree BB0 BB1 BB2 BB3 BB4 BB5
Background image of page 3

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

View Full DocumentRight Arrow Icon
- 3 - From Last Time: Improved Class Problem (2) c = b + a b = a + 1 a = b * c b = c - a a = a - c c = b * c a = b = c = BB0 BB1 BB2 BB3 BB4 BB5 BB0 BB1 BB2 BB3 BB4 BB5 For each join point X in the CFG For each predecessor, Y, of X in the CFG Run up to the IDOM(X) in the dominator tree, adding X to DF(N) for each N between Y and IDOM(X) BB DF 0 - 1 - 2 4 3 4, 5 4 5 5 1 Step 2: Dominance Frontier
Background image of page 4
- 4 - From Last Time: Improved Class Problem (3) c = b + a b = a + 1 a = b * c b = c - a a = a - c c = b * c a = b = c = BB0 BB1 BB2 BB3 BB4 BB5 BB DF 0 - 1 - 2 4 3 4, 5 4 5 5 1 Step 3: Insert Phi Nodes For each global name n For each BB b in which n is defined For each BB d in b‟s dominance frontier - Insert a Phi node for n in d - Add d to n‟s list of defining BBs a = Phi(a,a) b = Phi(b,b) c = Phi(c,c) a = Phi(a,a) b = Phi(b,b) c = Phi(c,c) a = Phi(a,a) b = Phi(b,b) c = Phi(c,c) Step 4: Rename variables Do in class
Background image of page 5

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

View Full DocumentRight Arrow Icon
- 5 - Code Optimization Make the code run faster on the target processor » My (Scott‟s) favorite topic !! » Other objectives: Power, code size Classes of optimization » 1. Classical (machine independent) Reducing operation count (redundancy elimination) Simplifying operations Generally good for any kind of machine » 2. Machine specific Peephole optimizations Take advantage of specialized hardware features » 3. Parallelism enhancing Increasing parallelism (ILP or TLP) Possibly increase instructions
Background image of page 6
A Tour Through the Classical Optimizations For this class – Go over concepts of a small subset of the optimizations » What it is, why its useful » When can it be applied (set of conditions that must be satisfied) » How it works
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 25

583L8 - EECS 583 Class 8 Classic Optimization University of...

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

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