]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/rpo/rpo-docs.factor
functors: inline the parts of interpolate this needs
[factor.git] / basis / compiler / cfg / rpo / rpo-docs.factor
1 USING: compiler.cfg help.markup help.syntax quotations sequences ;
2 IN: compiler.cfg.rpo
3
4 HELP: number-blocks
5 { $values { "blocks" sequence } }
6 { $description "Initializes the " { $slot "number" } " slot of each " { $link basic-block } "." }
7 { $examples
8   { $example
9     "USING: accessors compiler.cfg compiler.cfg.rpo kernel prettyprint sequences ;"
10     "10 [ <basic-block> ] replicate dup number-blocks [ number>> ] map ."
11     "{ 9 8 7 6 5 4 3 2 1 0 }"
12   }
13 } ;
14
15 HELP: post-order
16 { $values { "cfg" cfg } { "blocks" sequence } }
17 { $description "Lists the blocks in the cfg sorted in descending order on the " { $slot "number" } " slot. The blocks are first numbered if they haven't already been." } ;
18
19 HELP: each-basic-block
20 { $values { "cfg" cfg } { "quot" quotation } }
21 { $description "Applies a quotation to each basic block in the cfg." } ;
22
23 HELP: optimize-basic-block
24 { $values { "bb" basic-block } { "quot" quotation } }
25 { $description "Performs one " { $link simple-optimization } " step. The quotation takes the instructions of the basic block and returns them back in an optimized form." } ;
26
27 HELP: simple-analysis
28 { $values { "cfg" cfg } { "quot" quotation } }
29 { $description "Applies a quotation to each sequence of instructions in each " { $link basic-block } " in the cfg." } ;
30
31 HELP: simple-optimization
32 { $values { "cfg" cfg } { "quot" quotation } }
33 { $description "Runs a quotation that optimizes each " { $link basic-block } " in the cfg, excluding the kill blocks. The quotation takes the blocks instruction sequence and returns them back in optimized form. The blocks are iterated in " { $link reverse-post-order } "." } ;