Content
- Basic Blocks
- Local Optimizations
- Register Allocation
- Object Code Optimizations
Basic Blocks
A segment of code that must enter at beginning and exits only at end.
- Local optimizations
- Optimizations accross BBs
Local Optimizations
- Constant folding
- Constant propagation
- Algebraic simplification & reassociation
- Operator strength reduction
- Copy propagation
- Dead code elimination/remove unreachable code
- Common subexpression elimination
- Code motion: move statements evaluating to the same value in every iteration outside of loop
- Remove redundant jumps
- Branch chaining
Register Allocation
k-coloring graph problem.
Object Code Optimizations
- Instruction scheduling
- Redundant load & stores