Compiler Design
Compiler Design
Announcements
OH all t is !ee"# As" $uestions %ia email& As" $uestions %ia Pia''a& No late submissions#
, ere ,e Are
Source 1ode
, ere ,e Are
Source 1ode
Fan-TAC-stic!
, ere ,e Are
Source 1ode
At t is 0oint, !e a%e o0timi'ed .R code t at needs to +e con%erted into t e target language 2e#g# assem+ly, mac ine code3# /oal o* t is stage:
1 oose t e a00ro0riate mac ine instructions *or eac .R instruction# 4i%%y u0 *inite mac ine resources 2registers, cac es, etc#3 .m0lement lo!5le%el details o* t e runtime en%ironment#
Mac ine5s0eci*ic o0timi'ations are o*ten done ere, t oug some are treated as 0art o* a *inal o0timi'ation 0 ase#
O%er%ie!
Ho! to assign %aria+les to *initely many registers7 , at to do ! en it can8t +e done7 Ho! to do so e**icienty7 Ho! to detect reclaima+le memory7 Ho! to reclaim memory e**iciently7
Memory 6radeo**s
6 ere is an enormous tradeo** +et!een speed and size in memory# SRAM is *ast +ut %ery e(0ensi%e:
1an "ee0 u0 !it 0rocessor s0eeds in t e /H'# As o* 900:, cost is ;10<M= /ood luc" +uying 16= o* t e stu**& As o* 9019, you can +uy a 96= ard dri%e *or a+out ;100 As o* 9019, good dis" see" times are measured in ms 2a+out t!o to *our million times slo!er t an a 0rocessor cycle&3
6 e Memory Hierarc y
Idea: 6ry to get t e +est o* all !orlds +y using multi0le ty0es o* memory#
6 e Memory Hierarc y
Idea: 6ry to get t e +est o* all !orlds +y using multi0le ty0es o* memory#
Registers
6 e Memory Hierarc y
Idea: 6ry to get t e +est o* all !orlds +y using multi0le ty0es o* memory#
Registers
9>?= 5 8@= 1?@= A ?4@= 1M= 5 4M= 4/= A 9>?/= >00/=B H!G"
6 e Memory Hierarc y
Idea: 6ry to get t e +est o* all !orlds +y using multi0le ty0es o* memory#
Registers
All %aria+les li%e in Cmemory#D 4is" and net!or" e(0licitly andled se0arately#
Position o+jects in a !ay t at ta"es ma(imum ad%antage o* t e memory ierarc y# 4o so !it out ints *rom t e 0rogrammer#
Registers
can +e accessed $uic"ly, can a%e com0utations 0er*ormed on t em, and e(ist in small $uantity#
A good register allocator can generate code orders o* magnitude +etter t an a +ad register allocator#
Register Allocation
.n 6A1, t ere are an unlimited num+er o* %aria+les# On a 0 ysical mac ine t ere are a small num+er o* registers:
(8? as *our general50ur0ose registers and a num+er o* s0eciali'ed registers# M.PS as t!enty5*our general50ur0ose registers and eig t s0ecial50ur0ose registers#
Register allocation is t e 0rocess o* assigning %aria+les to registers and managing data trans*er in and out o* registers#
O*ten su+stantially more .R %aria+les t an registers# Feed to *ind a !ay to reuse registers ! ene%er 0ossi+le# (8?: Gac register made o* se%eral smaller registersH can8t use a register and its constituent registers at t e same time# (8?: 1ertain instructions must store t eir results in s0eci*ic registersH can8t store %alues t ere i* you !ant to use t ose instructions# M.PS: Some registers reser%ed *or t e assem+ler or o0erating system# Most arc itectures: Some registers must +e 0reser%ed across *unction calls#
FaI%e 2CnoD3 register allocation# -inear scan register allocation# /ra0 5coloring register allocation#
Idea: Store e%ery %alue in main memory, loading %alues only ! en t ey8re needed# 6o generate a code t at 0er*orms a com0utation:
/enerate load instructions to 0ull t e %alues *rom main memory into registers# /enerate code to 0er*orm t e com0utation on t e registers# /enerate store instructions to store t e result +ac" into main memory#
a b c d
a b c d
lw
$t0, -12(fp)
a b c d
lw lw
a b c d
a b c d
lw lw add sw
a b c d
lw lw add sw
a b c d
lw lw add sw lw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp)
a b c d
lw lw add sw lw sw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp) $t0, -20(fp)
a b c d
lw lw add sw lw sw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp) $t0, -20(fp)
a b c d
lw lw add sw lw sw lw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp) $t0, -20(fp) $t0, -8(fp)
a b c d
lw lw add sw lw sw lw lw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp) $t0, -20(fp) $t0, -8(fp) $t1, -20(fp)
a b c d
lw lw add sw lw sw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp) $t0, -20(fp)
a b c d
lw lw add sw lw sw lw lw add sw
$t0, -12(fp) $t1, -16(fp) $t2, $t0, $t1 $t2, -8(fp) $t0, -8(fp) $t0, -20(fp) $t0, -8(fp) $t1, -20(fp) $t2, $t0, $t1 $t2, -16(fp)
a b c d
.ssues unnecessary loads and stores +y t e do'en# ,astes s0ace on %alues t at could +e stored 0urely in registers# Gasily an order o* magnitude or t!o slo!er t an necessary# Enacce0ta+le in any 0roduction com0iler# 1an translate eac 0iece o* .R directly to assem+ly as !e go# Fe%er need to !orry a+out running out o* registers# Fe%er need to !orry a+out *unction calls or s0ecial50ur0ose registers# /ood i* you just needed to get a 0rototy0e com0iler u0 and running#
Ad%antage: #im%licity#
Reduces memory reads<!rites# Reduces total memory usage# , ic registers do !e 0ut %aria+les in7 , at do !e do ! en !e run out o* registers7
Register 1onsistency
a = b + c
d = a
d = b
e = d
Register 1onsistency
At eac 0rogram 0oint, eac register olds at most one li%e %aria+le#
1an assign se%eral %aria+les t e same register i* no t!o o* t em e%er !ill +e read toget er#
Recall: A %aria+le is li/e at a 0articular 0rogram 0oint i* its %alue may +e read later +e*ore it is !ritten#
6 e li/e range *or a %aria+le is t e set o* 0rogram 0oints at ! ic t at %aria+le is li%e# 6 e li/e inter/al *or a %aria+le is t e smallest su+range o* t e .R code containing all a %aria+le8s li%e ranges#
A 0ro0erty o* t e .R code, not t e 1J/# -ess 0recise t an li%e ranges, +ut sim0ler to !or" !it #
f = b + c
f = f + b
d = e + f
d = e f
g = d
f = b + c
f = f + b
d = e + f
d = e f
g = d { g }
f = b + c
f = f + b
d = e + f
d = e f
{ d } g = d { g }
f = b + c
f = f + b
d = e + f { d } { d } g = d { g }
d = e f
f = b + c
f = f + b
{ e, f } d = e + f { d } { d } g = d { g }
d = e f
f = b + c
f = f + b
{ e, f } d = e + f { d } { d } g = d { g }
d = e f { d }
f = b + c
f = f + b
{ e, f } d = e + f { d } { d } g = d { g }
{ e, f } d = e f { d }
f = b + c
f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
f = b + c
{ b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f} { b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
/i%en t e li%e inter%als *or all t e %aria+les in t e 0rogram, !e can allocate registers using a sim0le greedy algorit m# .dea: 6rac" ! ic registers are *ree at eac 0oint# , en a li%e inter%al +egins, gi%e t at %aria+le a *ree register# , en a li%e inter%al ends, t e register is once again *ree# ,e can8t al!ays *it e%eryt ing into a registerH !e8ll see ! at do to in a minute#
b d b e f b g b a b c
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R2 1
0ree Registers R) R1 R2 R2 1
0ree Registers R) R1 R2 R2 1
0ree Registers R) R1 R2 R2 1
0ree Registers R) R1 R2 R2 1
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R1 2
0ree Registers R) R1 R2 R1 2
Anot er G(am0le
Anot er G(am0le
b b c d b e b f b g b a
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
What do we do now?
Register S0illing
.* a register cannot +e *ound *or a %aria+le v, !e may need to s%ill a %aria+le# , en a %aria+le is s0illed, it is stored in memory rat er t an a register# , en !e need a register *or t e s0illed %aria+le:
G%ict some e(isting register to memory# -oad t e %aria+le into t e register# , en done, !rite t e register +ac" to memory and reload t e register !it its original %alue#
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
What do we do now?
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
Anot er G(am0le
b b c d b e b f b g b a
0ree Registers R) R1 R2
6 is algorit m is called linear scan register allocation and is a com0arati%ely ne! algorit m# Ad%antages:
Kery e**icient 2a*ter com0uting li%e inter%als, runs in linear time3 Produces good code in many instances# Allocation ste0 !or"s in one 0assH can generate code during iteration# O*ten used in L.6 com0ilers li"e La%a HotS0ot# .m0recise due to use o* li%e inter/als rat er t an li%e ranges# Ot er tec ni$ues "no!n to +e su0erior in many cases#
4isad%antages:
-i%e inter%als are conser%ati%e a00ro(imations o* li%e ranges# Fo t!o %aria+les !it o%erla00ing li%e ranges 0laced in t e same register#
A more aggressi%e %ersion o* linear5scan# Eses li%e ranges instead o* li%e inter/als# .* a %aria+le must +e s0illed, don8t s0ill all uses o* it#
Re$uires a *inal data5*lo! analysis to con*irm %aria+les are assigned consistent locations# See CMuality and S0eed in -inear5scan Register AllocationD +y 6rau+, Hollo!ay, and Smit #
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
0ree Registers R) R1 R2
What can we infer from all these variables being live at this point?
b a g f
c d e
b a g f
c d e
b a g f
c d e
b a g f
c d e
R)
Registers R1 R2 R1 b c d
a g f e
R)
Registers R1 R2 R1 b c d
a g f e
Gac node is a %aria+le# 6 ere is an edge +et!een t!o %aria+les t at are li%e at t e same 0rogram 0oint#
Per*orm register allocation +y assigning eac %aria+le a di**erent register *rom all o* its neig +ors# 6 ere8s just one catc ###
6 e One 1atc
6 is 0ro+lem is e$ui%alent to gra%h, coloring, ! ic is N&,hard i* t ere are at least t ree registers# Fo good 0olynomial5time algorit ms 2or e%en good a00ro(imations&3 are "no!n *or t is 0ro+lem# ,e a%e to +e content !it a euristic t at is good enoug *or R./s t at arise in 0ractice#
.* you can *igure out a !ay to assign registers to ar+itrary R./s, you8%e just 0ro%en & N N& and !ill get a 213)))3))) check *rom t e 1lay Mat ematics .nstitute#
.* you can *igure out a !ay to assign registers to ar+itrary R./s, you8%e just 0ro%en & N N& and !ill get a 213)))3))) check *rom t e 1lay Mat ematics .nstitute#
=attling N&5Hardness
1 aitin8s Algorit m
.ntuition:
Su00ose !e are trying to k5color a gra0 and *ind a node !it *e!er t an k edges# .* !e delete t is node *rom t e gra0 and color ! at remains, !e can *ind a color *or t is node i* !e add it +ac" in# Reason: ,it *e!er t an k neig +ors, some color must +e le*t o%er# Jind a node !it *e!er t an k outgoing edges# Remo%e it *rom t e gra0 # Recursi%ely color t e rest o* t e gra0 # Add t e node +ac" in# Assign it a %alid color#
Algorit m:
1 aitin8s Algorit m
1 aitin8s Algorit m
b c
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c g a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c f g a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c g a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c g a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c a e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c e
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
d b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
1 aitin8s Algorit m
b c
R)
Registers R1 R2 R1
One Pro+lem
, at i* !e can8t *ind a node !it *e!er t an k neig +ors7 1 oose and remo%e an ar+itrary node, mar"ing it Ctrou+lesome#D
, en adding node +ac" in, it may +e 0ossi+le to *ind a %alid color# Ot er!ise, !e a%e to s0ill t at node#
e f g
f g
f g
A Smarter Algorit m
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f}
Registers R) R1 R2 b a c d g f e
(spilled)
{ b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
A Smarter Algorit m
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f}
Registers R) R1 R2 b a c d g f e
(spilled)
{ b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
A Smarter Algorit m
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f}
Registers R) R1 R2 b a c d g f e
(spilled)
{ b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
A Smarter Algorit m
{ a, b, c, d } e = d + a { b, c, e } { b, c, e } f = b + c { b, e, f}
Registers R) R1 R2 b a c d d f e
(spilled)
{ b, e, f } f = f + b { e, f } { e, f } d = e + f { d } { d } g = d { g } { e, f } d = e f { d }
Anot er G(am0le
Anot er G(am0le
b a f e c d
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d d f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c d d f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
f e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d e b
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
c a
Registers R) R1 R2
Anot er G(am0le
b a f e c d
Registers R) R1 R2
Anot er G(am0le
b a f e c
(spilled)
Registers R) R1 R2
Anot er G(am0le
b a f e c
(spilled)
Registers R) R1 R2
Anot er G(am0le
b
(spilled)
(spilled)
a f e
Registers R) R1 R2
1 aitin8s Algorit m
Ad%antages:
Jor many control5*lo! gra0 s, *inds an e(cellent assignment o* %aria+les to registers# , en distinguis ing %aria+les +y use, 0roduces a 0recise R./# O*ten used in 0roduction com0ilers li"e /11# 1ore a00roac +ased on t e FP5 ard gra0 coloring 0ro+lem# Heuristic may 0roduce 0at ologically !orst5case assignments#
4isad%antages:
Automatic i* !e assign eac %aria+le one register# Re$uires a *e! tric"s i* !e se0arate +y use case#
.m0ro%ements to t e Algorit m
Ese euristics 2least5commonly used, greatest im0ro%ement, etc#3 to determine ! at to s0ill# , en s0illing a %aria+le, recom0ute t e R./ +ased on t e s0ill and use a ne! coloring to *ind a register#
1ritical ste0 in all o0timi'ing com0ilers# 6 e linear scan algorit m uses li/e inter/als to greedily assign %aria+les to registers#
Chaitin4s algorithm uses t e register inter'erence gra%h 2+ased on li/e ranges3 and gra%h coloring to assign registers#
Fe(t 6ime
Garbage Collection