Lesson 10--Register Allocation Flashcards

1
Q

True or False: Register allocation is a must for CISC

A

False. All operands are in memory and there are long instructions to retrieve and use them.

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

True or False: Register allocation is a must for RISC

A

True

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

True or False: Register allocation is a must for VLIW

A

True

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

True or False: Register allocation saves energy on embedded processors

A

True. It reduces memory accesses, which are energy hogs.

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

Register allocation

A

Determines which of the values should be in registers at each execution point

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

Register assignment

A

Determines which register should be used by each allocated value

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

Goal of register allocation

A

To minimize the traffic between the CPU and the memory hierarchy

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

Three parameters that are positively impacted by better register allocation

A

Speed
Code size
energy efficiency

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

gen

A

variable is newly defined

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

kill

A

old value is no longer accessible

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

def

A

on the left hand side

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

use

A

on the right hand side

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

live

A

variable will be used again

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

dead

A

variable will never be used again

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

web

A

The live range for each value

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

interference

A

overlapping ranges

17
Q

spill cost

A

how many definitions and uses are in a range

18
Q

allocation

A

which webs get a register

19
Q

spilling and splitting

A

Split webs if needed

20
Q

def-use (DU) chains

A

­–connects definition to all reachable uses
­–conditions for putting defs and uses into the same web
­–definition and all reachable uses must be part of the same web
­–all defs that reach the same use must be in the same web

21
Q

Graph Coloring Heuristics

A

–Remove nodes that have degree < N
­–push the removed nodes onto the stack
­–When all the remaining nodes have a degree >= N
­–Find the node with the least spill cost and push it onto the stack
­–What we are doing is ordering the nodes on the stack in the order of their spill cost. The
top of the stack will have the highest spill cost, the bottom of the stack will have the least
spill cost. The nodes with the highest spill costs will get registers.
­–When all the list of nodes is empty, it is time to start coloring.

22
Q

Options when coloring fails

A
  1. Pick a web and allocate the value in memory. All the definitions go to memory, all uses come from memory.
  2. Split the web into multiple webs.
23
Q

Cost

A

of executions * cost of instruction