-USING: tools.test random sorting sequences sets hashtables assocs
-kernel fry arrays splitting namespaces math accessors vectors locals
+USING: tools.test random sorting sequences hashtables assocs
+kernel arrays splitting namespaces math accessors vectors
math.order grouping strings strings.private classes layouts
cpu.architecture
compiler.cfg
] unit-test
{ 0 0 } [
- 1 live-intervals get at [ start>> ] [ end>> ] bi
+ 1 live-intervals get at ranges>> ranges-endpoints
] unit-test
! Live interval splitting
} representations set
: clean-up-split ( a b -- a b )
- [ dup [ [ >vector ] change-uses [ >vector ] change-ranges ] when ] bi@ ;
+ [ [ [ >vector ] change-uses [ >vector ] change-ranges ] ?call ] bi@ ;
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 2 }
{ uses V{ T{ vreg-use f 0 float-rep f } T{ vreg-use f 1 f float-rep } } }
{ ranges V{ { 0 2 } } }
{ spill-to T{ spill-slot f 0 } }
}
T{ live-interval-state
{ vreg 1 }
- { start 5 }
- { end 5 }
{ uses V{ T{ vreg-use f 5 f float-rep } } }
{ ranges V{ { 5 5 } } }
{ reload-from T{ spill-slot f 0 } }
} [
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 5 }
{ uses
V{
T{ vreg-use f 0 float-rep f }
f
T{ live-interval-state
{ vreg 2 }
- { start 1 }
- { end 5 }
{ uses V{ T{ vreg-use f 1 f float-rep } T{ vreg-use f 5 f float-rep } } }
{ ranges V{ { 1 5 } } }
{ reload-from T{ spill-slot f 4 } }
} [
T{ live-interval-state
{ vreg 2 }
- { start 0 }
- { end 5 }
{ uses
V{
T{ vreg-use f 0 float-rep f }
{
T{ live-interval-state
{ vreg 3 }
- { start 0 }
- { end 2 }
{ uses V{ T{ vreg-use f 0 float-rep f } T{ vreg-use f 1 f float-rep } } }
{ ranges V{ { 0 2 } } }
{ spill-to T{ spill-slot f 8 } }
} [
T{ live-interval-state
{ vreg 3 }
- { start 0 }
- { end 5 }
{ uses
V{
T{ vreg-use f 0 float-rep f }
{
T{ live-interval-state
{ vreg 4 }
- { start 0 }
- { end 1 }
{ uses V{ T{ vreg-use f 0 float-rep f } } }
{ ranges V{ { 0 1 } } }
{ spill-to T{ spill-slot f 12 } }
}
T{ live-interval-state
{ vreg 4 }
- { start 20 }
- { end 30 }
{ uses V{ T{ vreg-use f 20 f float-rep } T{ vreg-use f 30 f float-rep } } }
{ ranges V{ { 20 30 } } }
{ reload-from T{ spill-slot f 12 } }
} [
T{ live-interval-state
{ vreg 4 }
- { start 0 }
- { end 30 }
{ uses
V{
T{ vreg-use f 0 float-rep f }
{
T{ live-interval-state
{ vreg 5 }
- { start 0 }
- { end 1 }
{ uses V{ T{ vreg-use f 0 float-rep f } } }
{ ranges V{ { 0 1 } } }
{ spill-to T{ spill-slot f 16 } }
}
T{ live-interval-state
{ vreg 5 }
- { start 20 }
- { end 30 }
{ uses V{ T{ vreg-use f 20 float-rep f } T{ vreg-use f 30 f float-rep } } }
{ ranges V{ { 20 30 } } }
}
} [
T{ live-interval-state
{ vreg 5 }
- { start 0 }
- { end 30 }
{ uses
V{
T{ vreg-use f 0 float-rep f }
{
T{ live-interval-state
{ vreg 6 }
- { start 0 }
- { end 11 }
{ uses V{ T{ vreg-use f 0 float-rep f } T{ vreg-use f 10 double-rep float-rep } } }
{ ranges V{ { 0 11 } } }
{ spill-to T{ spill-slot f 24 } }
}
T{ live-interval-state
{ vreg 6 }
- { start 20 }
- { end 20 }
{ uses V{ T{ vreg-use f 20 f double-rep } } }
{ ranges V{ { 20 20 } } }
{ reload-from T{ spill-slot f 24 } }
} [
T{ live-interval-state
{ vreg 6 }
- { start 0 }
- { end 20 }
{ uses
V{
T{ vreg-use f 0 float-rep f }
f
T{ live-interval-state
{ vreg 7 }
- { start 8 }
- { end 8 }
{ ranges V{ { 8 8 } } }
{ uses V{ T{ vreg-use f 8 int-rep } } }
}
} [
T{ live-interval-state
{ vreg 7 }
- { start 4 }
- { end 8 }
{ ranges V{ { 4 8 } } }
{ uses V{ T{ vreg-use f 8 int-rep } } }
} 4 split-for-spill
{
T{ live-interval-state
{ vreg 8 }
- { start 0 }
- { end 3 }
{ ranges V{ { 0 3 } } }
{ uses V{ T{ vreg-use f 0 f int-rep } T{ vreg-use f 2 f int-rep } } }
{ spill-to T{ spill-slot f 32 } }
}
T{ live-interval-state
{ vreg 8 }
- { start 14 }
- { end 16 }
{ ranges V{ { 14 16 } } }
{ uses V{ T{ vreg-use f 14 f int-rep } } }
{ reload-from T{ spill-slot f 32 } }
} [
T{ live-interval-state
{ vreg 8 }
- { start 0 }
- { end 16 }
{ ranges V{ { 0 4 } { 6 10 } { 12 16 } } }
{ uses
V{
T{ live-interval-state
{ vreg 1 }
{ reg 1 }
- { start 1 }
- { end 15 }
+ { ranges V{ { 1 15 } } }
{ uses
V{
T{ vreg-use f 1 int-rep f }
T{ live-interval-state
{ vreg 2 }
{ reg 2 }
- { start 3 }
- { end 8 }
+ { ranges V{ { 3 8 } } }
{ uses
V{
T{ vreg-use f 3 int-rep f }
T{ live-interval-state
{ vreg 3 }
{ reg 3 }
- { start 3 }
- { end 10 }
+ { ranges V{ { 3 10 } } }
{ uses V{ T{ vreg-use f 3 int-rep f } T{ vreg-use f 10 f int-rep } } }
}
}
} active-intervals set
H{ } inactive-intervals set
T{ live-interval-state
- { vreg 1 }
- { start 5 }
- { end 5 }
- { uses V{ T{ vreg-use f 5 int-rep f } } }
+ { vreg 1 }
+ { ranges V{ { 5 5 } } }
+ { uses V{ T{ vreg-use f 5 int-rep f } } }
}
spill-status
] unit-test
T{ live-interval-state
{ vreg 1 }
{ reg 1 }
- { start 1 }
- { end 15 }
+ { ranges V{ { 1 15 } } }
{ uses V{ T{ vreg-use f 1 int-rep f } } }
}
T{ live-interval-state
{ vreg 2 }
{ reg 2 }
- { start 3 }
- { end 8 }
{ uses V{ T{ vreg-use f 3 int-rep f } T{ vreg-use f 8 f int-rep } } }
}
}
} active-intervals set
H{ } inactive-intervals set
T{ live-interval-state
- { vreg 3 }
- { start 5 }
- { end 5 }
- { uses V{ T{ vreg-use f 5 int-rep f } } }
+ { vreg 3 }
+ { ranges V{ { 5 5 } } }
+ { uses V{ T{ vreg-use f 5 int-rep f } } }
}
spill-status
] unit-test
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 100 }
{ uses V{ T{ vreg-use f 0 int-rep f } T{ vreg-use f 100 f int-rep } } }
{ ranges V{ { 0 100 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 10 }
{ uses V{ T{ vreg-use f 0 int-rep f } T{ vreg-use f 10 f int-rep } } }
{ ranges V{ { 0 10 } } }
}
T{ live-interval-state
{ vreg 2 }
- { start 11 }
- { end 20 }
{ uses V{ T{ vreg-use f 11 int-rep f } T{ vreg-use f 20 f int-rep } } }
{ ranges V{ { 11 20 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 100 }
{ uses V{ T{ vreg-use f 0 int-rep f } T{ vreg-use f 100 f int-rep } } }
{ ranges V{ { 0 100 } } }
}
T{ live-interval-state
{ vreg 2 }
- { start 30 }
- { end 60 }
{ uses V{ T{ vreg-use f 30 int-rep f } T{ vreg-use f 60 f int-rep } } }
{ ranges V{ { 30 60 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 100 }
{ uses V{ T{ vreg-use f 0 int-rep f } T{ vreg-use f 100 f int-rep } } }
{ ranges V{ { 0 100 } } }
}
T{ live-interval-state
{ vreg 2 }
- { start 30 }
- { end 200 }
{ uses V{ T{ vreg-use f 30 int-rep f } T{ vreg-use f 200 f int-rep } } }
{ ranges V{ { 30 200 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 100 }
{ uses V{ T{ vreg-use f 0 int-rep f } T{ vreg-use f 100 f int-rep } } }
{ ranges V{ { 0 100 } } }
}
T{ live-interval-state
{ vreg 2 }
- { start 30 }
- { end 100 }
{ uses V{ T{ vreg-use f 30 int-rep f } T{ vreg-use f 100 f int-rep } } }
{ ranges V{ { 30 100 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 20 }
{ uses
V{
T{ vreg-use f 0 int-rep f }
}
T{ live-interval-state
{ vreg 2 }
- { start 0 }
- { end 20 }
{ uses
V{
T{ vreg-use f 0 int-rep f }
}
T{ live-interval-state
{ vreg 3 }
- { start 4 }
- { end 8 }
{ uses V{ T{ vreg-use f 6 int-rep f } } }
{ ranges V{ { 4 8 } } }
}
T{ live-interval-state
{ vreg 4 }
- { start 4 }
- { end 8 }
{ uses V{ T{ vreg-use f 8 int-rep f } } }
{ ranges V{ { 4 8 } } }
}
! This guy will invoke the 'spill partially available' code path
T{ live-interval-state
{ vreg 5 }
- { start 4 }
- { end 8 }
{ uses V{ T{ vreg-use f 8 int-rep f } } }
{ ranges V{ { 4 8 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 10 }
{ uses V{ T{ vreg-use f 0 int-rep f } T{ vreg-use f 6 f int-rep } T{ vreg-use f 10 f int-rep } } }
{ ranges V{ { 0 10 } } }
}
! This guy will invoke the 'spill new' code path
T{ live-interval-state
{ vreg 5 }
- { start 2 }
- { end 8 }
{ uses V{ T{ vreg-use f 8 int-rep f } } }
{ ranges V{ { 2 8 } } }
}
{
T{ live-interval-state
{ vreg 1 }
- { start 0 }
- { end 20 }
{ reg 0 }
{ ranges V{ { 0 2 } { 10 20 } } }
{ uses V{ 0 2 10 20 } }
T{ live-interval-state
{ vreg 2 }
- { start 4 }
- { end 40 }
{ reg 0 }
{ ranges V{ { 4 6 } { 30 40 } } }
{ uses V{ 4 6 30 40 } }
{
T{ live-interval-state
{ vreg 3 }
- { start 0 }
- { end 40 }
{ reg 1 }
{ ranges V{ { 0 40 } } }
{ uses V{ 0 40 } }
T{ live-interval-state
{ vreg 4 }
- { start 8 }
- { end 10 }
{ ranges V{ { 8 10 } } }
{ uses V{ T{ vreg-use f 8 int-rep f } T{ vreg-use f 10 f int-rep } } }
}