Optimization++
- Complexities and strategies of optimization
- Instruction Scheduling
- Register Allocation
Optimization++ Complexities and strategies of optimization - - PowerPoint PPT Presentation
Optimization++ Complexities and strategies of optimization Instruction Scheduling Register Allocation Optimization Recap 1. Intermediate language (IL) module - better separation of front-end and back-end modules - permit
* available expressions, avail. copies, useless vars, …
* common subexpressionn elmination, copy propagation, useless expressions (stmts), redunction in strength with induction variable elimination
– can bloat code, replication hurts instruction cache locality
– e.g., reduce 2 simple instructions to 1 complex instruction
– Also easier to implement (50/10 rule? ;)
– Focusing optimizations in inner loops means optimization is 80% faster, yet 80% effective
Jeanne Ferrante Brad Calder Andrew Chien Scott Baden Jeanne Ferrante Brad Calder Andrew Chien Scott Baden
(1s, 2i) (1s, 2i) (0s, 1i) (1s, 2i) (1s, 2i) (0s, 1i)
(all predecessors scheduled)
(creates most choices)
(all predecessors scheduled)
(creates most choices)
not as big a win
not as big a win
lifetime
Repeat until all registers allocated:
*prioritize to non-trivial, dense:
(2c, 1/3d) (3c, 1d) (3c, 3/4d) (2c, 1/2d)
r3 r1 r2 r3