diff --git a/basis/compiler/tree/cleanup/cleanup-docs.factor b/basis/compiler/tree/cleanup/cleanup-docs.factor index a64cc45229..45a8bb3941 100644 --- a/basis/compiler/tree/cleanup/cleanup-docs.factor +++ b/basis/compiler/tree/cleanup/cleanup-docs.factor @@ -1,9 +1,15 @@ -USING: help.markup help.syntax sequences ; +USING: compiler.tree help.markup help.syntax kernel sequences ; IN: compiler.tree.cleanup -ARTICLE: "compiler.tree.cleanup" "Cleanup Phase" -"A phase run after propagation to finish the job, so to speak. Codifies speculative inlining decisions, deletes branches marked as never taken, and flattens local recursive blocks that do not call themselves." ; +HELP: cleanup-folding? +{ $values { "#call" #call } { "?" boolean } } +{ $description "Checks if a " { $link #call } " node can be folded." } ; HELP: cleanup-tree { $values { "nodes" sequence } { "nodes'" sequence } } { $description "Main entry point for the cleanup-tree optimization phase." } ; + +ARTICLE: "compiler.tree.cleanup" "Cleanup Phase" +"A phase run after propagation to finish the job, so to speak. Codifies speculative inlining decisions, deletes branches marked as never taken, and flattens local recursive blocks that do not call themselves." ; + +ABOUT: "compiler.tree.cleanup" diff --git a/basis/compiler/tree/dead-code/dead-code-docs.factor b/basis/compiler/tree/dead-code/dead-code-docs.factor new file mode 100644 index 0000000000..3841556bc0 --- /dev/null +++ b/basis/compiler/tree/dead-code/dead-code-docs.factor @@ -0,0 +1,6 @@ +USING: help.markup help.syntax ; +IN: compiler.tree.dead-code + +ARTICLE: "compiler.tree.dead-code" "Dead code elimination" "In this compiler pass, nodes that have no effect on the words output are removed." ; + +ABOUT: "compiler.tree.dead-code" diff --git a/basis/compiler/tree/propagation/info/info-docs.factor b/basis/compiler/tree/propagation/info/info-docs.factor index 4e11f5bacc..f2e0f0fe03 100644 --- a/basis/compiler/tree/propagation/info/info-docs.factor +++ b/basis/compiler/tree/propagation/info/info-docs.factor @@ -1,6 +1,14 @@ USING: compiler.tree help.markup help.syntax sequences ; IN: compiler.tree.propagation.info +HELP: node-input-infos +{ $values { "node" node } { "seq" sequence } } +{ $description "Lists the value infos for the input variables of an SSA tree node." } ; + +HELP: node-output-infos +{ $values { "node" node } { "seq" sequence } } +{ $description "Lists the value infos for the output variables of an SSA tree node." } ; + HELP: value-info-state { $class-description "Represents constraints the compiler knows about the input and output variables to an SSA tree node. It has the following slots:" { $table @@ -12,10 +20,5 @@ HELP: value-info-state } } ; -HELP: node-input-infos -{ $values { "node" node } { "seq" sequence } } -{ $description "Lists the value infos for the input variables of an SSA tree node." } ; - -HELP: node-output-infos -{ $values { "node" node } { "seq" sequence } } -{ $description "Lists the value infos for the output variables of an SSA tree node." } ; +HELP: value-infos +{ $var-description "Assoc stack of current value --> info mapping" } ; diff --git a/basis/compiler/tree/propagation/info/info.factor b/basis/compiler/tree/propagation/info/info.factor index 3af16a4fed..15564ba563 100644 --- a/basis/compiler/tree/propagation/info/info.factor +++ b/basis/compiler/tree/propagation/info/info.factor @@ -286,7 +286,6 @@ DEFER: (value-info-union) ] } cond ; -! Assoc stack of current value --> info mapping SYMBOL: value-infos : value-info* ( value -- info ? ) diff --git a/basis/compiler/tree/propagation/propagation-docs.factor b/basis/compiler/tree/propagation/propagation-docs.factor index 039ea44692..cfad4f1fa8 100644 --- a/basis/compiler/tree/propagation/propagation-docs.factor +++ b/basis/compiler/tree/propagation/propagation-docs.factor @@ -50,3 +50,8 @@ HELP: propagate { $description "Performs the propagation pass of the AST optimization. All nodes info slots are initialized here." } { $examples { $unchecked-example $[ propagate-ex ] } } ; + +ARTICLE: "compiler.tree.propagation" "Class, interval, constant propagation" +"This pass must be run after " { $vocab-link "compiler.tree.normalization" } "." ; + +ABOUT: "compiler.tree.propagation" diff --git a/basis/compiler/tree/propagation/propagation.factor b/basis/compiler/tree/propagation/propagation.factor index 01581f9198..d1571b163b 100644 --- a/basis/compiler/tree/propagation/propagation.factor +++ b/basis/compiler/tree/propagation/propagation.factor @@ -16,8 +16,6 @@ compiler.tree.propagation.transforms kernel namespaces ; IN: compiler.tree.propagation -! This pass must run after normalization - : propagate ( nodes -- nodes ) H{ } clone copies set H{ } clone 1array value-infos set diff --git a/basis/cpu/architecture/architecture-docs.factor b/basis/cpu/architecture/architecture-docs.factor index a6d1384bd6..d5217a6b27 100644 --- a/basis/cpu/architecture/architecture-docs.factor +++ b/basis/cpu/architecture/architecture-docs.factor @@ -292,7 +292,7 @@ HELP: stack-cleanup HELP: gc-root-offset { $values { "spill-slot" spill-slot } { "n" integer } } -{ $description "Offset in the " { $link stack-frame } " for the word being constructed where the spill slot is located, in " { $link cell } " units." } +{ $description "Offset in the " { $link stack-frame } " for the word being constructed where the spill slot is located. The value is given in " { $link cell } " units." } { $see-also vm:gc-info } ; ARTICLE: "cpu.architecture" "CPU architecture description model" @@ -323,4 +323,14 @@ $nl widen-vector-rep } "Slot access:" -{ $subsections %write-barrier } ; +{ $subsections + %set-slot + %set-slot-imm + %slot + %slot-imm + %write-barrier +} +"Spilling:" +{ $subsections gc-root-offset } ; + +ABOUT: "cpu.architecture"