From 6215561ad40fdc47e7ca499e43358a007371cc49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Wed, 22 Apr 2015 16:31:59 +0200 Subject: [PATCH] compiler.cfg.*: more docs and removing a test that isn't relevant anymore --- basis/bootstrap/compiler/timing/timing.factor | 4 ++-- basis/compiler/cfg/cfg-docs.factor | 2 +- .../linear-scan/allocation/spilling/spilling-docs.factor | 8 +++++++- .../cfg/linear-scan/assignment/assignment-docs.factor | 5 +++++ .../linear-scan/live-intervals/live-intervals-docs.factor | 4 ++++ .../compiler/cfg/linearization/linearization-tests.factor | 8 -------- basis/compiler/cfg/liveness/liveness-docs.factor | 4 ++++ 7 files changed, 23 insertions(+), 12 deletions(-) diff --git a/basis/bootstrap/compiler/timing/timing.factor b/basis/bootstrap/compiler/timing/timing.factor index 199887f2a4..8b67623401 100644 --- a/basis/bootstrap/compiler/timing/timing.factor +++ b/basis/bootstrap/compiler/timing/timing.factor @@ -21,7 +21,7 @@ IN: bootstrap.compiler.timing : 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 ) [ @@ -39,4 +39,4 @@ IN: bootstrap.compiler.timing \ 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 diff --git a/basis/compiler/cfg/cfg-docs.factor b/basis/compiler/cfg/cfg-docs.factor index a0a82bf2f2..10fa5b9440 100644 --- a/basis/compiler/cfg/cfg-docs.factor +++ b/basis/compiler/cfg/cfg-docs.factor @@ -18,7 +18,7 @@ HELP: { $description "Creates a new empty basic block. The " { $slot "id" } " slot is initialized with the value of the basic-block " { $link counter } "." } ; HELP: -{ $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 diff --git a/basis/compiler/cfg/linear-scan/allocation/spilling/spilling-docs.factor b/basis/compiler/cfg/linear-scan/allocation/spilling/spilling-docs.factor index 3b05a3e8f4..6fad4bab0b 100644 --- a/basis/compiler/cfg/linear-scan/allocation/spilling/spilling-docs.factor +++ b/basis/compiler/cfg/linear-scan/allocation/spilling/spilling-docs.factor @@ -1,6 +1,12 @@ -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 } diff --git a/basis/compiler/cfg/linear-scan/assignment/assignment-docs.factor b/basis/compiler/cfg/linear-scan/assignment/assignment-docs.factor index bd6daaf427..bf288e1d42 100644 --- a/basis/compiler/cfg/linear-scan/assignment/assignment-docs.factor +++ b/basis/compiler/cfg/linear-scan/assignment/assignment-docs.factor @@ -25,6 +25,11 @@ HELP: assign-registers-in-insn { $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." } ; diff --git a/basis/compiler/cfg/linear-scan/live-intervals/live-intervals-docs.factor b/basis/compiler/cfg/linear-scan/live-intervals/live-intervals-docs.factor index 0fdeb219f4..f27e0dced0 100644 --- a/basis/compiler/cfg/linear-scan/live-intervals/live-intervals-docs.factor +++ b/basis/compiler/cfg/linear-scan/live-intervals/live-intervals-docs.factor @@ -27,6 +27,10 @@ HELP: live-interval-state { $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." } diff --git a/basis/compiler/cfg/linearization/linearization-tests.factor b/basis/compiler/cfg/linearization/linearization-tests.factor index 6fcef868e2..93b5b86d74 100644 --- a/basis/compiler/cfg/linearization/linearization-tests.factor +++ b/basis/compiler/cfg/linearization/linearization-tests.factor @@ -23,11 +23,3 @@ V{ } 2 test-bb V{ } 10 insns>block [ process-block ] V{ } make [ number>> ] map ] unit-test - -! process-successor -{ V{ 10 } } [ - work-list set - HS{ } clone visited set - V{ } 10 insns>block process-successor - work-list get dlist>sequence [ number>> ] map -] unit-test diff --git a/basis/compiler/cfg/liveness/liveness-docs.factor b/basis/compiler/cfg/liveness/liveness-docs.factor index db40cb60de..fea54c0760 100644 --- a/basis/compiler/cfg/liveness/liveness-docs.factor +++ b/basis/compiler/cfg/liveness/liveness-docs.factor @@ -34,6 +34,10 @@ HELP: live-in? { $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" }