A Polynomial Spilling Heuristic: Layered Allocation Boubacar Diouf 1 - - PowerPoint PPT Presentation

a polynomial spilling heuristic layered allocation
SMART_READER_LITE
LIVE PREVIEW

A Polynomial Spilling Heuristic: Layered Allocation Boubacar Diouf 1 - - PowerPoint PPT Presentation

erieure de Paris . . . . . . . erieure de Lyon Introduction Layered Approach Evaluation Conclusion A Polynomial Spilling Heuristic: Layered Allocation Boubacar Diouf 1 2 , Albert Cohen 1 2 , Fabrice Rastello 1 2 1 INRIA 2 Ecole Normale


slide-1
SLIDE 1

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Polynomial Spilling Heuristic: Layered Allocation

Boubacar Diouf1 2, Albert Cohen1 2, Fabrice Rastello1 2

1INRIA 2 ´ Ecole Normale Sup´ erieure de Paris 3 ´ Ecole Normale Sup´ erieure de Lyon Layered Allocation 1 / 20

slide-2
SLIDE 2

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Register Allocation

The register allocation problem maps temporary variables to machine registers

The Allocation/Spilling Problem

  • The allocation chooses the register residents
  • It also aims at minimizing the load/store overhead

Assignment/Coloring

  • The coloring decides which register is used by which variable

Decoupling

  • For the moment, let us assume that these two problems can be decoupled

Layered Allocation 2 / 20

slide-3
SLIDE 3

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Register Allocation

The register allocation problem maps temporary variables to machine registers

The Allocation/Spilling Problem

  • The allocation chooses the register residents
  • It also aims at minimizing the load/store overhead

Assignment/Coloring

  • The coloring decides which register is used by which variable

Decoupling

  • For the moment, let us assume that these two problems can be decoupled

Layered Allocation 2 / 20

slide-4
SLIDE 4

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Register Allocation

The register allocation problem maps temporary variables to machine registers

The Allocation/Spilling Problem

  • The allocation chooses the register residents
  • It also aims at minimizing the load/store overhead

Assignment/Coloring

  • The coloring decides which register is used by which variable

Decoupling

  • For the moment, let us assume that these two problems can be decoupled

Layered Allocation 2 / 20

slide-5
SLIDE 5

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Register Allocation

The register allocation problem maps temporary variables to machine registers

The Allocation/Spilling Problem

  • The allocation chooses the register residents
  • It also aims at minimizing the load/store overhead

Assignment/Coloring

  • The coloring decides which register is used by which variable

Decoupling

  • For the moment, let us assume that these two problems can be decoupled

Layered Allocation 2 / 20

slide-6
SLIDE 6

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A bit of Terminology

  • Maxlive: the maximum number of simultaneously live variables
  • Given V a set of variables of a program and R a number of available registers

Two sub-problems

  • The lowering problem finds S, a subset of V , of minimum cost to spill in order to

decrease maxlive by a small number

  • The single layer allocation problem finds A, a subset of V , of maximum cost to

allocate to a small number of registers

Two Approaches to the Allocation Problem

  • The layered allocation incrementally solves the single layer allocation problem

until the sum of the used registers reaches R

  • The incremental lowering incrementally solves the lowering problem until maxlive

reaches R

Layered Allocation 3 / 20

slide-7
SLIDE 7

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A bit of Terminology

  • Maxlive: the maximum number of simultaneously live variables
  • Given V a set of variables of a program and R a number of available registers

Two sub-problems

  • The lowering problem finds S, a subset of V , of minimum cost to spill in order to

decrease maxlive by a small number

  • The single layer allocation problem finds A, a subset of V , of maximum cost to

allocate to a small number of registers

Two Approaches to the Allocation Problem

  • The layered allocation incrementally solves the single layer allocation problem

until the sum of the used registers reaches R

  • The incremental lowering incrementally solves the lowering problem until maxlive

reaches R

Layered Allocation 3 / 20

slide-8
SLIDE 8

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A bit of Terminology

  • Maxlive: the maximum number of simultaneously live variables
  • Given V a set of variables of a program and R a number of available registers

Two sub-problems

  • The lowering problem finds S, a subset of V , of minimum cost to spill in order to

decrease maxlive by a small number

  • The single layer allocation problem finds A, a subset of V , of maximum cost to

allocate to a small number of registers

Two Approaches to the Allocation Problem

  • The layered allocation incrementally solves the single layer allocation problem

until the sum of the used registers reaches R

  • The incremental lowering incrementally solves the lowering problem until maxlive

reaches R

Layered Allocation 3 / 20

slide-9
SLIDE 9

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A bit of Terminology

  • Maxlive: the maximum number of simultaneously live variables
  • Given V a set of variables of a program and R a number of available registers

Two sub-problems

  • The lowering problem finds S, a subset of V , of minimum cost to spill in order to

decrease maxlive by a small number

  • The single layer allocation problem finds A, a subset of V , of maximum cost to

allocate to a small number of registers

Two Approaches to the Allocation Problem

  • The layered allocation incrementally solves the single layer allocation problem

until the sum of the used registers reaches R

  • The incremental lowering incrementally solves the lowering problem until maxlive

reaches R

Layered Allocation 3 / 20

slide-10
SLIDE 10

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables maxlive

Layered Allocation 4 / 20

slide-11
SLIDE 11

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive

Layered Allocation 4 / 20

slide-12
SLIDE 12

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive maxlive - small

Layered Allocation 4 / 20

slide-13
SLIDE 13

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive maxlive - small Spilling some variables in order to lower maxlive by small is NP-complete Even if small = 1!

Layered Allocation 4 / 20

slide-14
SLIDE 14

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive small

Layered Allocation 4 / 20

slide-15
SLIDE 15

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive small Allocating variables to a small number of registers is polynomial!

Layered Allocation 4 / 20

slide-16
SLIDE 16

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive small Proceeding by layered allocation is still polynomial!

Layered Allocation 4 / 20

slide-17
SLIDE 17

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive small Proceeding by layered allocation is still polynomial!

Layered Allocation 4 / 20

slide-18
SLIDE 18

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Lowering vs. Layering

Program points Number of live variables R maxlive maxlive - small small NP-complete Polynomial

Layered Allocation 4 / 20

slide-19
SLIDE 19

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Why should the Layered Allocation be Close to Optimal?

  • Let us assume that we have a program P
  • When R + 1 registers are available, let us call SPILLP

R+1 the optimal set of

variables to spill to make a coloring possible

  • For most programs, SPILLP

R+1 ⊂ SPILLP R

[Diouf’10]

  • Hence, for most programs, ALLOCP

R ⊂ ALLOCP R+1

Layered Allocation 5 / 20

slide-20
SLIDE 20

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Taxonomy of the Approaches

Approach Complexity Quality Allocation/Spilling NP-complete Optimal Layered Allocation Polynomial Close to optimal Incremental lowering-optimal NP-complete ??? Incremental lowering-heuristic Polynomial Not-optimal

To make it clear!

  • The Allocation problem is NP-complete
  • The Layered allocation is a heuristic that is close to optimal allocation
  • We are not turning an NP-complete problem into a polynomial one

Layered Allocation 6 / 20

slide-21
SLIDE 21

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Taxonomy of the Approaches

Approach Complexity Quality Allocation/Spilling NP-complete Optimal Layered Allocation Polynomial Close to optimal Incremental lowering-optimal NP-complete ??? Incremental lowering-heuristic Polynomial Not-optimal

To make it clear!

  • The Allocation problem is NP-complete
  • The Layered allocation is a heuristic that is close to optimal allocation
  • We are not turning an NP-complete problem into a polynomial one

Layered Allocation 6 / 20

slide-22
SLIDE 22

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Taxonomy of the Approaches

Approach Complexity Quality Allocation/Spilling NP-complete Optimal Layered Allocation Polynomial Close to optimal Incremental lowering-optimal NP-complete ??? Incremental lowering-heuristic Polynomial Not-optimal

To make it clear!

  • The Allocation problem is NP-complete
  • The Layered allocation is a heuristic that is close to optimal allocation
  • We are not turning an NP-complete problem into a polynomial one

Layered Allocation 6 / 20

slide-23
SLIDE 23

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Taxonomy of the Approaches

Approach Complexity Quality Allocation/Spilling NP-complete Optimal Layered Allocation Polynomial Close to optimal Incremental lowering-optimal NP-complete ??? Incremental lowering-heuristic Polynomial Not-optimal

To make it clear!

  • The Allocation problem is NP-complete
  • The Layered allocation is a heuristic that is close to optimal allocation
  • We are not turning an NP-complete problem into a polynomial one

Layered Allocation 6 / 20

slide-24
SLIDE 24

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Outline Introduction Layered Approach

Layered-Heuristic Allocation: General Graphs Layered-Optimal Allocation: Chordal Graphs

Experimental Evaluation Conclusion

Layered Allocation 6 / 20

slide-25
SLIDE 25

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Two Heuristics for the Spilling Problem

Input:

  • 1. A register allocation problem where each variable has an estimated spill cost
  • 2. A number of available registers

Objective:

We want to perform an allocation that minimizes the cost of all the spilled variables

Two graph-based solutions :

  • The general approach: Layered-Heuristic Register Allocator
  • The SSA-based approach: Layered-Optimal Register Allocator

Layered Allocation 7 / 20

slide-26
SLIDE 26

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The General Approach

Given an interference graph of a program and R available registers (colors)

  • 1. Assume that we have one register
  • 2. We approximate the set of nodes of maximum cost/weight to allocate with one

register: a layer. This layer is an independent set.

  • 3. Remove the nodes of the layer from the graph at the next iteration

Repeat these instructions until we reach R or we allocate all the variables

Layered Allocation 8 / 20

slide-27
SLIDE 27

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-28
SLIDE 28

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers Variables sorted by decreasing cost: a, e, c, b, d, f b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-29
SLIDE 29

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a Variables sorted by decreasing cost: a, e, c, b, d, f b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-30
SLIDE 30

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} Variables sorted by decreasing cost: e, c, b, d, f b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-31
SLIDE 31

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} Variables sorted by decreasing cost: c, b, d, f b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-32
SLIDE 32

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} Variables sorted by decreasing cost: b, d, f I-Set-2: {c,f b a c d e f 3 6 4 3 5 1 I-Set-3: {b,d}

Layered Allocation 9 / 20

slide-33
SLIDE 33

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} I-Set-2: {c,f} I-Set-3: {b,d} b a c d e f 3 6 4 3 5 1 Variables sorted by decreasing cost: b, d, f

Layered Allocation 9 / 20

slide-34
SLIDE 34

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} I-Set-2: {c,f} I-Set-3: {b,d} b a c d e f 3 6 4 3 5 1 Variables sorted by decreasing cost: f

Layered Allocation 9 / 20

slide-35
SLIDE 35

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} Variables sorted by decreasing cost: I-Set-2: {c,f} I-Set-3: {b,d} I-Sets sorted by decreasing cost: I-Set-1, I-Set-3, I-Set-2 b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-36
SLIDE 36

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} Variables sorted by decreasing cost: I-Set-2: {c,f} I-Set-3: {b,d} I-Sets sorted by decreasing cost: I-Set-1, I-Set-3, I-Set-2 The cost of the allocation is 5 b a c d e f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-37
SLIDE 37

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Heuristic Works

2 available registers I-Set-1: {a,e} Variables sorted by decreasing cost: I-Set-2: {c,f} I-Set-3: {b,d} I-Sets sorted by decreasing cost: I-Set-1, I-Set-3, I-Set-2 The cost of the allocation is 5

b a

c

d e

f 3 6 4 3 5 1

Layered Allocation 9 / 20

slide-38
SLIDE 38

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Outline Introduction Layered Approach

Layered-Heuristic Allocation: General Graphs Layered-Optimal Allocation: Chordal Graphs

Experimental Evaluation Conclusion

Layered Allocation 10 / 20

slide-39
SLIDE 39

Introduction . . . . . . . Layered Approach Evaluation Conclusion

SSA-based Interference Graphs

The interference graph of an SSA-based program is chordal

  • 1. The allocation problem can be decoupled from the coloring problem thanks to

maxlive

  • 2. Hence, the maximum weighted independent set can be found optimally [Frank’75]

Layered Allocation 11 / 20

slide-40
SLIDE 40

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-41
SLIDE 41

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

iteration a f d e b g c red vertices

  • 1 6 5 2 2 1 2

Ø Red vertices d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-42
SLIDE 42

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

iteration a f d e b g c red vertices

  • 1 6 5 2 2 1 2

Ø 1 5 4 2 2 1 2 a Red vertices d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-43
SLIDE 43

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

iteration a f d e b g c red vertices

  • 1 6 5 2 2 1 2

Ø 1 5 4 2 2 1 2 a 2

  • 1 -3 2 1 2

f, a 5

  • 1 0

b,f,a Red vertices d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-44
SLIDE 44

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

iteration a f d e b g c red vertices

  • 1 6 5 2 2 1 2

Ø 1 5 4 2 2 1 2 a 2

  • 1 -3 2 1 2

f, a 5

  • 1 0

b,f,a iteration red vertices blue vertices

  • b,f,a

Ø Red vertices Blue vertices d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-45
SLIDE 45

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

iteration a f d e b g c red vertices

  • 1 6 5 2 2 1 2

Ø 1 5 4 2 2 1 2 a 2

  • 1 -3 2 1 2

f, a 5

  • 1 0

b,f,a iteration red vertices blue vertices

  • b,f,a

Ø 1 f,a b Red vertices Blue vertices d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-46
SLIDE 46

Introduction . . . . . . . Layered Approach Evaluation Conclusion

The Maximum Weighted Independent Set Algorithm

iteration a f d e b g c red vertices

  • 1 6 5 2 2 1 2

Ø 1 5 4 2 2 1 2 a 2

  • 1 -3 2 1 2

f, a 5

  • 1 0

b,f,a iteration red vertices blue vertices

  • b,f,a

Ø 1 f,a b 2 Ø b, f Red vertices Blue vertices d f c a e g b 2 1 5 2 2 6 1 Weighted graph

Layered Allocation 12 / 20

slide-47
SLIDE 47

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Optimal Allocator Works

2 available registers

d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 13 / 20

slide-48
SLIDE 48

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Optimal Allocator Works

2 available registers

d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 13 / 20

slide-49
SLIDE 49

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Optimal Allocator Works

2 available registers

d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 13 / 20

slide-50
SLIDE 50

Introduction . . . . . . . Layered Approach Evaluation Conclusion

How the Layered-Optimal Allocator Works

2 available registers

d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 13 / 20

slide-51
SLIDE 51

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A First Improvement: Weights Bias

d f c a e g b 2 1 5 2 2 6 1 Allocated variables: {f, b, d, g} Allocation-Cost = 14

2 available registers

Layered Allocation 14 / 20

slide-52
SLIDE 52

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A First Improvement: Weights Bias

d f c a e g b 2 1 5 2 2 6 1 Allocated variables: { }

2 available registers

Allocated variables: {f, b, d, g} Allocation-Cost = 14 d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 14 / 20

slide-53
SLIDE 53

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A First Improvement: Weights Bias

d f c a e g b 2 1 5 2 2 6 1 Allocated variables: {f, c}

2 available registers

Allocated variables: {f, b, d, g} Allocation-Cost = 14 d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 14 / 20

slide-54
SLIDE 54

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A First Improvement: Weights Bias

d f c a e g b 2 1 5 2 2 6 1 Allocated variables: {f, c, d, b}

2 available registers

Allocated variables: {f, b, d, g} Allocation-Cost = 14 d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 14 / 20

slide-55
SLIDE 55

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A First Improvement: Weights Bias

d f c a e g b 2 1 5 2 2 6 1 Allocated variables: {f, c, d, b} Allocation-Cost = 15

2 available registers

Allocated variables: {f, b, d, g} Allocation-Cost = 14 d f c a e g b 2 1 5 2 2 6 1

Layered Allocation 14 / 20

slide-56
SLIDE 56

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

d f c a e b 1 4 1 2 1 5

2 available registers

Layered Allocation 15 / 20

slide-57
SLIDE 57

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

2 available registers

d f c a e b 1 4 1 2 1 5

Layered Allocation 15 / 20

slide-58
SLIDE 58

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

2 available registers

d f c a e b 1 4 1 2 1 5

Layered Allocation 15 / 20

slide-59
SLIDE 59

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

2 available registers

d f c a e b 1 4 1 2 1 5 A maximal clique

Layered Allocation 15 / 20

slide-60
SLIDE 60

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

2 available registers

d f c a e b 1 4 1 2 1 5

Layered Allocation 15 / 20

slide-61
SLIDE 61

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

2 available registers

d f c a e b 1 4 1 2 1 5

Layered Allocation 15 / 20

slide-62
SLIDE 62

Introduction . . . . . . . Layered Approach Evaluation Conclusion

A Second Improvement: A Fixed Point Iteration

2 available registers

d f c a e b 1 4 1 2 1 5

Layered Allocation 15 / 20

slide-63
SLIDE 63

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Outline Introduction Layered Approach

Layered-Heuristic Allocation: General Graphs Layered-Optimal Allocation: Chordal Graphs

Experimental Evaluation Conclusion

Layered Allocation 16 / 20

slide-64
SLIDE 64

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Evaluating the Layered-Heuristic Allocator

Architectures

  • x86

Benchmarks extracted from JikesRVM

  • SPEC JVM 98

Algorithms

  • LS: the linear scan implemented in JikesRVM
  • BLS: a variant of the Belady’s furthest -first
  • GC: the Chaitin-Briggs optimistic graph coloring
  • Optimal: an ILP-based Allocator
  • LH: Layered Heuristic

Layered Allocation 17 / 20

slide-65
SLIDE 65

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Evaluating the Layered-Heuristic Allocator

DLS BLS GC LH Optimal check compress jess raytrace db javac mpegaudio mtrt jack

Number of available registers

0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5

Normalized allocation cost Layered Allocation 17 / 20

slide-66
SLIDE 66

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Evaluating the Layered-Heuristic Allocator

DLS BLS GC LH Optimal 2 registers 4 registers 6 registers 8 registers 10 registers 12 registers 14 registers 16 registers

Number of available registers

0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75

Normalized allocation cost Layered Allocation 17 / 20

slide-67
SLIDE 67

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Evaluating the Layered-Optimal Allocator

Architectures

  • ARMv7
  • ST231

Benchmarks

  • eembc
  • lao-kernels
  • SPEC CPU 2000int

Algorithms

  • GC: the Chaitin-Briggs optimistic graph coloring
  • Optimal: an ILP-based Allocator
  • L: our baseline Layered-Optimal approach
  • BL: the biased variant of our Layered-Optimal
  • FPL: the fixed-point variant of our Layered-Optimal
  • BFPL: the biased and fixed-point variant of our Layered-Optimal

Layered Allocation 18 / 20

slide-68
SLIDE 68

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Evaluating the Layered-Optimal Allocator

GC NL FPL BL BFPL Optimal 1 registers 2 registers 4 registers 8 registers 16 registers 32 registers

Number of available registers

0.00 0.25 0.50 0.75 1.00 1.25

Normalized Allocation Cost Layered Allocation 18 / 20

slide-69
SLIDE 69

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Evaluating the Layered-Optimal Allocator

GC NL BL FPL BFPL

1_register 2_registers 4_registers 8_registers 16_registers 32_registers

Number of available registers

0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70

Normalized allocation cost

Layered Allocation 18 / 20

slide-70
SLIDE 70

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Outline Introduction Layered Approach

Layered-Heuristic Allocation: General Graphs Layered-Optimal Allocation: Chordal Graphs

Experimental Evaluation Conclusion

Layered Allocation 19 / 20

slide-71
SLIDE 71

Introduction . . . . . . . Layered Approach Evaluation Conclusion

Conclusion

Contributions

  • Layered allocation: polynomial and close to optimal allocation
  • Iteratively allocate instead of (classical) iteratively spilling
  • The approach works on general graphs and on SSA-based graphs

Layered Allocation 20 / 20