]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/cfg/ssa/destruction/coalescing/coalescing-docs.factor
ui.listener: document that ~/.factor-history persists input history
[factor.git] / basis / compiler / cfg / ssa / destruction / coalescing / coalescing-docs.factor
1 USING: compiler.cfg compiler.cfg.instructions
2 compiler.cfg.ssa.destruction.leaders compiler.cfg.ssa.interference
3 help.markup help.syntax kernel make sequences ;
4 IN: compiler.cfg.ssa.destruction.coalescing
5
6 HELP: class-element-map
7 { $var-description "Maps leaders to equivalence class elements which are sequences of " { $link vreg-info } " instances." } ;
8
9 HELP: coalesce-cfg
10 { $values { "cfg" cfg } }
11 { $description "In this step, " { $link leader-map } " info is calculated." } ;
12
13 HELP: coalesce-elements
14 { $values { "merged" "??" } { "follower" "vreg" } { "leader" "vreg" } }
15 { $description "Delete follower's class, and set leaders's class to merged." } ;
16
17 HELP: coalesce-now
18 { $values { "insn" insn } }
19 { $description "Generic word which finds copy pairs in instructions and tries to eliminate them directly." }
20 { $see-also coalesce-later } ;
21
22 HELP: coalesce-later
23 { $values { "insn" insn } }
24 { $description "Generic word supposed to be called in a " { $link make } " context which generates a list of eliminatable vreg copies. The copies are batched up and then eliminated by " { $link try-eliminate-copies } "." } ;
25
26 HELP: coalesce-vregs
27 { $values { "merged" "??" } { "follower" "vreg" } { "leader" "vreg" } }
28 { $description "Sets 'leader' as the leader of 'follower'." } ;
29
30 HELP: eliminatable-copy?
31 { $values { "vreg1" "vreg" } { "vreg2" "vreg" } { "?" boolean } }
32 { $description "Determines if a vreg copy can be eliminated. It can be eliminated if the vregs have the same register class and same representation size." } ;
33
34 HELP: try-eliminate-copy
35 { $values { "follower" "vreg" } { "leader" "vreg" } { "must?" boolean } }
36 { $description "Tries to eliminate a vreg copy from 'leader' to 'follower'. If 'must?' is " { $link t } " then a " { $link vregs-shouldn't-interfere } " error is thrown if the vregs interfere." }
37 { $see-also try-eliminate-copies vregs-interfere? } ;
38
39 HELP: try-eliminate-copies
40 { $values { "pairs" "a sequence of vreg pairs" } { "must?" boolean } }
41 { $description "Tries to eliminate the vreg copies in the " { $link sequence } " 'pairs'. If 'must?' is " { $link t } " then a " { $link vregs-shouldn't-interfere } " error is thrown if any of the vregs interfere." }
42 { $see-also try-eliminate-copy } ;
43
44 ARTICLE: "compiler.cfg.ssa.destruction.coalescing" "Vreg Coalescing"
45 "This compiler pass eliminates redundant vreg copies. Coalescing occurs in two steps. First all redundant copies in all " { $link ##tagged>integer } " and " { $link ##phi } " instructions are handled. Then those in other instructions like " { $link vreg-insn } ", " { $link ##copy } " and " { $link ##parallel-copy } "."
46 $nl
47 "Main entry point:"
48 { $subsections coalesce-cfg }
49 "Vreg copy elimination:"
50 { $subsections
51   try-eliminate-copies
52   try-eliminate-copy
53 } ;