From 3b86d4b9ba607c522bd7a0135852db9156cf0701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sun, 16 Nov 2014 10:59:13 +0100 Subject: [PATCH] compiler.cfg.def-use: docs --- .../compiler/cfg/def-use/def-use-docs.factor | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/basis/compiler/cfg/def-use/def-use-docs.factor b/basis/compiler/cfg/def-use/def-use-docs.factor index 39e9eb6a7f..320e0550bb 100644 --- a/basis/compiler/cfg/def-use/def-use-docs.factor +++ b/basis/compiler/cfg/def-use/def-use-docs.factor @@ -1,6 +1,11 @@ -USING: compiler.cfg.instructions help.markup help.syntax sequences ; +USING: compiler.cfg compiler.cfg.instructions help.markup help.syntax +sequences ; IN: compiler.cfg.def-use +HELP: compute-insns +{ $values { "cfg" cfg } } +{ $description "Computes a mapping from vregs to the instructions that define them and store the result in the " { $link insns } " variable." } ; + HELP: defs-vregs { $values { "insn" insn } { "seq" sequence } } { $description "Returns the sequence of vregs defined, or introduced, by this instruction." } @@ -12,6 +17,14 @@ HELP: defs-vregs } } ; +HELP: insn-of +{ $values { "vreg" "virtual register" } { "insn" insn } } +{ $description "Maps the vreg to the instruction that defined it." } ; + +HELP: temp-vregs +{ $values { "insn" insn } { "seq" sequence } } +{ $description "Returns the sequence of temporary vregs used by this instruction." } ; + HELP: uses-vregs { $values { "insn" insn } { "seq" sequence } } { $description "Returns the sequence of vregs used by this instruction." } @@ -23,6 +36,14 @@ HELP: uses-vregs } } ; -HELP: temp-vregs -{ $values { "insn" insn } { "seq" sequence } } -{ $description "Returns the sequence of temporary vregs used by this instruction." } ; +ARTICLE: "compiler.cfg.def-use" "Common code used by several passes for def-use analysis" +"The " { $vocab-link "compiler.cfg.def-use" } " contains tools to correlate SSA instructions with virtual registers defined or used by them." +$nl +"Vregs for a given instruction:" +{ $subsections + defs-vregs + temp-vregs + uses-vregs +} ; + +ABOUT: "compiler.cfg.def-use"