Where can we optimize? (control)
CPI contributed by control stalls can be decreased by
- compiler optimizations
- Reduce the number of branches: loop unrolling
- Speculative execution
- Static (software) or dynamic (hardware) branch prediction
- Code movement : execute instructions before knowing that they will need to be executed (beware of exceptions)
- Predication