: machine-passes ( -- seq ) \ compiler.cfg.finalization:finalize-cfg passes ;
-: linear-scan-passes ( -- seq ) \ compiler.cfg.linear-scan:(linear-scan) passes ;
+: linear-scan-passes ( -- seq ) \ compiler.cfg.linear-scan:linear-scan passes ;
: all-passes ( -- seq )
[
\ compiler.cfg.liveness.ssa:compute-ssa-live-sets ,
] { } make ;
-all-passes [ [ reset ] [ add-timing ] bi ] each
\ No newline at end of file
+all-passes [ [ reset ] [ add-timing ] bi ] each
{ $description "Creates a new empty basic block. The " { $slot "id" } " slot is initialized with the value of the basic-block " { $link counter } "." } ;
HELP: <cfg>
-{ $values { "entry" basic-block } { "word" word } { "label" "label" } { "cfg" cfg } }
+{ $values { "word" word } { "label" "label" } { "entry" basic-block } { "cfg" cfg } }
{ $description "Constructor for " { $link cfg } ". " { $slot "spill-area-size" } " and " { $slot "spill-area-align" } " are set to default values." } ;
HELP: cfg
-USING: compiler.cfg.linear-scan.live-intervals help.markup help.syntax ;
+USING: compiler.cfg.linear-scan.allocation.state
+compiler.cfg.linear-scan.live-intervals help.markup help.syntax ;
IN: compiler.cfg.linear-scan.allocation.spilling
+HELP: assign-spill
+{ $values { "live-interval" live-interval } }
+{ $description "Assigns a spill slot for the live interval." }
+{ $see-also assign-spill-slot } ;
+
HELP: spill-before
{ $values
{ "before" live-interval-state }
{ $values { "insn" insn } }
{ $description "Assigns physical registers and spill slots for the virtual registers used by the instruction." } ;
+HELP: compute-live-in
+{ $values { "bb" basic-block } }
+{ $description "" }
+{ $see-also machine-live-ins } ;
+
HELP: machine-edge-live-ins
{ $var-description "Mapping from basic blocks to predecessors to values which are live on a particular incoming edge." } ;
{ $slot "reg" }
{ "The allocated register, set in the " { $link allocate-registers } " step." }
}
+ {
+ { $slot "spill-rep" }
+ { "Representation the vreg will have when it is spilled." }
+ }
{
{ $slot "spill-to" }
{ { $link spill-slot } " to use for spilling, if it needs to be spilled." }
V{ } 10 insns>block [ process-block ] V{ } make
[ number>> ] map
] unit-test
-
-! process-successor
-{ V{ 10 } } [
- <dlist> work-list set
- HS{ } clone visited set
- V{ } 10 insns>block process-successor
- work-list get dlist>sequence [ number>> ] map
-] unit-test
{ $values { "vreg" "virtual register" } { "bb" basic-block } { "?" "a boolean" } }
{ $description "Whether the vreg is live in the block or not." } ;
+HELP: live-ins
+{ $var-description "Hash that maps from basic blocks to vregs that are live in them." }
+{ $see-also compute-live-sets } ;
+
HELP: lookup-base-pointer
{ $values { "vreg" "vreg" } { "vreg/f" "vreg or " { $link f } } }
{ $description "Tries to figure out what the base pointer for a vreg is. Can't use cache here because of infinite recursion inside the quotation passed to cache" }