{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec24mod

# lec24mod - CS415 Compilers Optimizations These slides are...

This preview shows pages 1–7. Sign up to view the full content.

CS415 Compilers Optimizations These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University

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

View Full Document
Lecture 24 2 cs415, spring 10 Project extension? read submission procedure carefully; credit reductions if you do not follow these procedures Wednesday, May 12, noon – 3:00pm, in this classroom, closed book/notes Recitation session: Monday, 11:00am? Final Road Map
Lecture 24 3 cs415, spring 10 tries to improve quality of code (may fail in some cases) optimizer typically consists of multiple passes different optimization (code improvement) objectives: • execution time reduction • reduction in resource requirements (memory, registers) • (peak) power and energy reduction criteria for effectiveness of optimizations safety - program semantics must be preserved • opportunity - how often can it be applied? • profitability - how much improvement? Compiler Optimization

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

View Full Document
Lecture 24 4 cs415, spring 10 addr[a] -, t1 *, t2 [ ], t3 i 4 4. t1 = addr(a)- 4 5. t2 = i * 4 6. t3 = t1[t2] . . . Basic Block DAG Construction Optimization: Local Common Subexpression Elimination (CSE) Source code: a(i) * a(i) a(i)
Lecture 24 5 cs415, spring 10 addr[a] -, t1, t4 *, t2, t5 [ ], t3, t6 i 4 4. t1 = addr(a)- 4 5. t2 = i * 4 6. t3 = t1[t2] 7. t4 = addr(a)- 4 8. t5 = i * 4 9. t6 = t4[t5] 10. t7 = t3 * t6 . . . *, t7 Basic Block DAG Construction a(i) * a(i)

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

View Full Document
Lecture 24 6 cs415, spring 10 t1 = addr[a]-4 t2 = i * 4 t3 = t1[t2] t7 = t3 * t3 addr[a] -, t1, t4 *, t2, t5 [ ], t3, t6 i 4 4. t1 = addr(a)- 4 5. t2 = i * 4 6. t3 = t1[t2] 7. t4 = addr(a)- 4 8. t5 = i * 4 9. t6 = t4[t5] 10. t7 = t3 * t6 . . .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}