1 USING: compiler.cfg help.markup help.syntax quotations sequences ;
5 { $values { "blocks" sequence } }
6 { $description "Initializes the " { $slot "number" } " slot of each " { $link basic-block } "." }
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 }"
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." } ;
19 HELP: each-basic-block
20 { $values { "cfg" cfg } { "quot" quotation } }
21 { $description "Applies a quotation to each basic block in the cfg." } ;
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." } ;
28 { $values { "cfg" cfg } { "quot" quotation } }
29 { $description "Applies a quotation to each sequence of instructions in each " { $link basic-block } " in the cfg." } ;
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 } "." } ;