Compiler ILP Flashcards
How can compilers help with ILP?
- Reduce dependency chains
- Move instructions around so that processor can see independent instructions soon (instead of just seeing long dependency chains)
How can a compiler reduce dependency chains?
Tree Height Reduction - Not always possible to do this => relies on associativity of addition, not all operations are associative
What are the techniques to make instructions easier for a processor to find?
- Instruction Scheduling
- Loop Unrolling
- Trace Scheduling
What is instruction scheduling?
Finding instructions that can be done in place of stalls (i.e. find instructions that the processor can do while it is waiting on a result). Can combine with if-conversion to interleave two potions of branch.
What are the pros of loop unrolling?
Reduces the number of instructions and can combine with instruction scheduling to reduce CPI
What are the cons of loop unrolling?
Causes code bloat and we won’t be able to use it if we don’t know the number of iterations ahead of time or if the number of iterations is not a multiple of N
What are the pros/cons of function inlining?
(+) eliminate call/return overhead, can allow for better scheduling (just more instructions to use)
(-) code bloat