]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/ssa/destruction/destruction-docs.factor
inverse: Fix docs
[factor.git] / basis / compiler / cfg / ssa / destruction / destruction-docs.factor
1 USING: compiler.cfg compiler.cfg.instructions
2 compiler.cfg.ssa.destruction.private compiler.cfg.ssa.destruction.leaders
3 compiler.cfg.ssa.interference help.markup help.syntax kernel sequences ;
4 IN: compiler.cfg.ssa.destruction
5
6 HELP: cleanup-cfg
7 { $values { "cfg" cfg } }
8 { $description "In this pass, useless copies are eliminated. " { $link ##phi } " instructions are removed and " { $link ##parallel-copy } " are transformed into regular " { $link ##copy } " instructions. Then for the copy instructions, which are ##copy and " { $link ##tagged>integer } " it is checked to see if the copy is useful. If it is not, the instruction is removed from the cfg." } ;
9
10 HELP: destruct-ssa
11 { $values { "cfg" cfg } }
12 { $description "Main entry point for the SSA destruction compiler pass." } ;
13
14 ARTICLE: "compiler.cfg.ssa.destruction" "SSA Destruction"
15 "SSA destruction compiler pass. It is preceded by " { $vocab-link "compiler.cfg.save-contexts" } " and followed by " { $vocab-link "compiler.cfg.linear-scan" } "."
16 $nl
17 "Because of the design of the register allocator, this pass has three peculiar properties."
18 { $list
19   { "Instead of renaming vreg usages in the CFG, a map from vregs to canonical representatives is computed. This allows the register allocator to use the original SSA names to get reaching definitions. See " { $link leader-map } "." }
20   { "Useless " { $link ##copy } " instructions, and all " { $link ##phi } " instructions, are eliminated, so the register allocator does not have to remove any redundant operations." }
21   { "This pass computes live sets and fills out the " { $slot "gc-roots" } " slots of GC maps with " { $vocab-link "compiler.cfg.liveness" } ", so the linear scan register allocator does not need to compute liveness again." }
22 }
23 $nl
24 "Main entry point:"
25 { $subsections destruct-ssa } ;
26
27 ABOUT: "compiler.cfg.ssa.destruction"