2015-04-20 15:22:09 -04:00
|
|
|
USING: accessors arrays compiler.cfg compiler.cfg.instructions
|
2014-12-13 23:45:40 -05:00
|
|
|
compiler.cfg.linear-scan.assignment compiler.cfg.linear-scan.live-intervals
|
2015-04-20 15:22:09 -04:00
|
|
|
compiler.cfg.registers compiler.cfg.ssa.destruction.leaders
|
|
|
|
compiler.cfg.utilities cpu.architecture cpu.x86.assembler.operands grouping
|
|
|
|
heaps kernel make namespaces random sequences sorting tools.test ;
|
2014-11-16 06:12:14 -05:00
|
|
|
IN: compiler.cfg.linear-scan.assignment.tests
|
|
|
|
|
2015-04-20 15:22:09 -04:00
|
|
|
{
|
|
|
|
T{ ##peek { dst RAX } { loc T{ ds-loc } } { insn# 0 } }
|
|
|
|
} [
|
|
|
|
H{ { 37 RAX } } pending-interval-assoc set
|
|
|
|
H{ { 37 int-rep } } representations set
|
|
|
|
H{ { 37 37 } } leader-map set
|
|
|
|
T{ ##peek f 37 D 0 0 } [ assign-insn-defs ] keep
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! assign-registers-in-block
|
|
|
|
{
|
|
|
|
V{ T{ ##inc { loc T{ ds-loc { n 3 } } } { insn# 7 } } }
|
|
|
|
} [
|
|
|
|
{ } init-assignment
|
|
|
|
V{ T{ ##inc { loc D 3 } { insn# 7 } } } 0 insns>block
|
|
|
|
[ assign-registers-in-block ] keep instructions>>
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
! insert-spill
|
2014-11-16 06:12:14 -05:00
|
|
|
{ { T{ ##spill { src RAX } } } } [
|
|
|
|
[
|
|
|
|
T{ live-interval-state { vreg 1234 } { reg RAX } } insert-spill
|
|
|
|
] { } make
|
|
|
|
] unit-test
|
2014-12-13 23:45:40 -05:00
|
|
|
|
|
|
|
{ V{ T{ ##spill { src RAX } { rep int-rep } } } } [
|
|
|
|
[
|
|
|
|
1234 int-regs <live-interval>
|
|
|
|
RAX >>reg int-rep >>spill-rep
|
|
|
|
insert-spill
|
|
|
|
] V{ } make
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ { 3 56 } } [
|
|
|
|
{ { 3 7 } { -1 56 } { -1 3 } } >min-heap [ -1 = ] heap-pop-while
|
|
|
|
natural-sort
|
|
|
|
] unit-test
|
|
|
|
|
|
|
|
{ 3 } [
|
|
|
|
{ 50 90 95 120 } [ 25 int-regs <live-interval> 2array ] map >min-heap
|
|
|
|
pending-interval-heap set 90 expire-old-intervals
|
|
|
|
pending-interval-heap get heap-size
|
|
|
|
] unit-test
|
2015-04-12 00:00:06 -04:00
|
|
|
|
|
|
|
{ } [
|
|
|
|
V{ T{ ##inc { loc D 3 } { insn# 7 } } } 0 insns>block block>cfg { }
|
|
|
|
assign-registers
|
|
|
|
] unit-test
|