Compiler ILP Flashcards

1
Q

How can compilers help with ILP?

A
  1. Reduce dependency chains
  2. Move instructions around so that processor can see independent instructions soon (instead of just seeing long dependency chains)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can a compiler reduce dependency chains?

A

Tree Height Reduction - Not always possible to do this => relies on associativity of addition, not all operations are associative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the techniques to make instructions easier for a processor to find?

A
  1. Instruction Scheduling
  2. Loop Unrolling
  3. Trace Scheduling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is instruction scheduling?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the pros of loop unrolling?

A

Reduces the number of instructions and can combine with instruction scheduling to reduce CPI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the cons of loop unrolling?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the pros/cons of function inlining?

A

(+) eliminate call/return overhead, can allow for better scheduling (just more instructions to use)
(-) code bloat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly