Handbook
Glossary
<mixed-loop-pressure> ( count hot-count hot cold -- graph )
Vocabulary
compiler
.
cfg
.
register-allocation
.
spill-sites
.
fixtures
Inputs
count
an
object
hot-count
an
object
hot
an
object
cold
an
object
Outputs
graph
an
object
Definition
USING:
accessors
compiler.cfg
compiler.cfg.comparisons
compiler.cfg.instructions
compiler.cfg.registers
compiler.cfg.utilities
kernel
layouts
make
math
namespaces
sequences
;
IN:
compiler.cfg.register-allocation.spill-sites.fixtures
::
<mixed-loop-pressure>
( count hot-count hot cold -- graph )
H{
}
clone
representations
set
0
vreg-counter
set
fresh-int
:>
input
fresh-int
:>
counter
fresh-int
:>
next-counter
fresh-int
:>
result
f
:>
values!
[
##prologue,
input
D:
0
##peek,
count
<iota>
[|
i |
fresh-int
dup
input i 1
+
tag-fixnum
##add-imm,
]
map
values!
##branch,
]
{
}
make
0
insns>block
:>
entry
<basic-block>
:>
header
f
:>
hot-result!
[
values hot-count
head
hot
sum-rounds
hot-result! next-counter counter 1
tag-fixnum
##sub-imm,
##branch,
]
{
}
make
2
insns>block
:>
body
[
values cold
sum-rounds
:>
cold-result
fresh-int
:>
total total cold-result
result
##add,
total
D:
0
##replace,
##epilogue,
##return,
]
{
}
make
3
insns>block
:>
done
[
counter
H{
{
entry input
}
{
body next-counter
}
}
##phi,
result
H{
{
entry input
}
{
body hot-result
}
}
##phi,
counter 0
cc>
##compare-integer-imm-branch,
]
V{
}
make
header
instructions<<
entry header
connect-bbs
header body
connect-bbs
header done
connect-bbs
body header
connect-bbs
loop-pressure-clobber?
get
[
body
[
hot-count 1
-
cut
[
f
{
}
{
}
{
}
{
}
0 0
[
]
##alien-assembly,
]
V{
}
make
swap
append
append
]
change-instructions
drop
]
when
entry
block>cfg
;