--- /dev/null
+USING: compiler.cfg.representations help.markup help.syntax ;
+IN: compiler.cfg.ssa.cssa
+
+ARTICLE: "compiler.cfg.ssa.cssa" "Conventional SSA Form"
+"Convert SSA to conventional SSA. This pass runs after representation selection (see " { $link select-representations } "), so it must keep track of representations when introducing new values." ;
+
+ABOUT: "compiler.cfg.ssa.cssa"
FROM: assocs => change-at ;
IN: compiler.cfg.ssa.cssa
-! Convert SSA to conventional SSA. This pass runs after representation
-! selection, so it must keep track of representations when introducing
-! new values.
-
SYMBOLS: edge-copies phi-copies ;
: init-copies ( bb -- )
--- /dev/null
+USING: compiler.cfg.instructions help.markup help.syntax ;
+IN: compiler.cfg.ssa.destruction
+
+ARTICLE: "compiler.cfg.ssa.destruction" "SSA Destruction"
+"Because of the design of the register allocator, this pass has three peculiar properties."
+{ $list
+ "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."
+ { "Useless " { $link ##copy } " instructions, and all " { $link ##phi } " instructions, are eliminated, so the register allocator does not have to remove any redundant operations." }
+ { "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." }
+} ;
+
+ABOUT: "compiler.cfg.ssa.destruction"
FROM: namespaces => set ;
IN: compiler.cfg.ssa.destruction
-! Because of the design of the register allocator, this pass
-! has three peculiar properties.
-!
-! 1) 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.
-! 2) Useless ##copy instructions, and all ##phi instructions,
-! are eliminated, so the register allocator does not have to
-! remove any redundant operations.
-! 3) This pass computes live sets and fills out GC maps with
-! compiler.cfg.liveness, so the linear scan register allocator
-! does not need to compute liveness again.
-
! Maps leaders to equivalence class elements.
SYMBOL: class-element-map
--- /dev/null
+USING: assocs compiler.cfg.ssa.destruction.leaders help.markup help.syntax math
+sequences ;
+IN: compiler.utilities
+
+HELP: compress-path
+{ $values { "source" integer } { "assoc" assoc } { "destination" integer } }
+{ $description "Gets the original definer for a vreg number. Then inserts a direct path from 'source' to that definer. For example if the assoc is " { $code "{ { 1 2 } { 2 3 } { 3 4 } { 4 4 } }" } "then the original definer of 1 is 4. The word is used by " { $link leader } " to figure out what the top leader of a vreg is." } ;
--- /dev/null
+USING: compiler.utilities kernel tools.test ;
+IN: compiler.utilities.tests
+
+{
+ 9
+ H{ { 9 9 } { 44 9 } { 7 9 } }
+} [
+ 7 H{ { 7 44 } { 44 9 } { 9 9 } } [ compress-path ] keep
+] unit-test