From e4dc3273f201ae741637b626998637cce973546b Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 2 Oct 2026 13:04:34 -0700 Subject: First pass README updates --- chapter04/docs/04-arg1.json | 16 +++ chapter04/docs/04-arg1.svg | 165 ++++++++++++------------- chapter04/docs/04-arg2.json | 16 +++ chapter04/docs/04-arg2.svg | 162 ++++++++++++------------ chapter04/docs/04-post-peephole.json | 18 +++ chapter04/docs/04-post-peephole.svg | 198 ++++++++++++++---------------- chapter04/docs/04-pre-peephole.json | 20 +++ chapter04/docs/04-pre-peephole.svg | 232 +++++++++++++++-------------------- chapter04/docs/Makefile | 13 +- chapter04/docs/projnode.json | 14 +++ chapter04/docs/projnode.svg | 74 +++++++++++ 11 files changed, 510 insertions(+), 418 deletions(-) create mode 100644 chapter04/docs/04-arg1.json create mode 100644 chapter04/docs/04-arg2.json create mode 100644 chapter04/docs/04-post-peephole.json create mode 100644 chapter04/docs/04-pre-peephole.json create mode 100644 chapter04/docs/projnode.json create mode 100644 chapter04/docs/projnode.svg (limited to 'chapter04/docs') diff --git a/chapter04/docs/04-arg1.json b/chapter04/docs/04-arg1.json new file mode 100644 index 00000000..b16dc51b --- /dev/null +++ b/chapter04/docs/04-arg1.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-arg1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 5, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-arg1.svg b/chapter04/docs/04-arg1.svg index cf4599c5..b948e7cd 100644 --- a/chapter04/docs/04-arg1.svg +++ b/chapter04/docs/04-arg1.svg @@ -1,84 +1,81 @@ - - - - - - -chapter04 - - -cluster_Nodes - - - -cluster_Scope1_0 - - - -cluster_Scope1_1 - - - - -Start2 - - -Start - - - -$ctrl - - - -Con_5 - -2 - - - -Return6 - -Return - - - -Return6->Start2:p0 - - -0 - - - -Return6->Con_5 - - -1 - - - -Scope1_0 - - -0 - -$ctrl - -arg - - - -Scope1_0:Scope1_0_arg->Con_5 - - - - - -Scope1_1 - - -1 - - - \ No newline at end of file +#1[1] → #5 · ASSOC · 0: arg#6[0] → #4 · CTRL#6[1] → #5 · DATAScope  #1#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #5 ASSOC 0: arg0: $ctrl0: arg01Start  #2#2 Start +Type not computed + +$ctrl  #4/0#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL2  #5#5 2 +Type not computed + +Return  #6#6 Return +Type not computed + +[0] → #4 CTRL +[1] → #5 DATA01 diff --git a/chapter04/docs/04-arg2.json b/chapter04/docs/04-arg2.json new file mode 100644 index 00000000..5d2d7fde --- /dev/null +++ b/chapter04/docs/04-arg2.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-arg2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 6, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 6, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-arg2.svg b/chapter04/docs/04-arg2.svg index 2b3b47a3..aebd8b0d 100644 --- a/chapter04/docs/04-arg2.svg +++ b/chapter04/docs/04-arg2.svg @@ -1,80 +1,82 @@ - - - - - - -chapter04 - - -cluster_Nodes - - - -cluster_Scope1_0 - - - -cluster_Scope1_1 - - - - -Start2 - - -Start - - - -$ctrl - -arg - - - -Return5 - -Return - - - -Return5->Start2:p0 - - -0 - - - -Return5->Start2:p1 - - -1 - - - -Scope1_0 - - -0 - -$ctrl - -arg - - - -Scope1_0:Scope1_0_arg->Start2:p1 - - - - - -Scope1_1 - - -1 - - - \ No newline at end of file +#1[1] → #6 · ASSOC · 0: arg#5[0] → #4 · CTRL#5[1] → #6 · DATAScope  #1#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #6 ASSOC 0: arg0: $ctrl0: arg01Start  #2#2 Start +Type not computed + +$ctrl  #4/0#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRLReturn  #5#5 Return +Type not computed + +[0] → #4 CTRL +[1] → #6 DATA01arg  #6/1#6 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA diff --git a/chapter04/docs/04-post-peephole.json b/chapter04/docs/04-post-peephole.json new file mode 100644 index 00000000..4890ca67 --- /dev/null +++ b/chapter04/docs/04-post-peephole.json @@ -0,0 +1,18 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-post-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 5, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 10, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 11, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-post-peephole.svg b/chapter04/docs/04-post-peephole.svg index 550c16ef..530155dd 100644 --- a/chapter04/docs/04-post-peephole.svg +++ b/chapter04/docs/04-post-peephole.svg @@ -1,108 +1,90 @@ - - - - - - -chapter04 - - -cluster_Nodes - - - -cluster_Scope1_0 - - - -cluster_Scope1_1 - - - - -Start2 - - -Start - - - -$ctrl - -arg - - - -Con_10 - -#3 - - - -Add11 - -+ - - - -Add11->Start2:p1 - - -1 - - - -Add11->Con_10 - - -2 - - - -Return12 - -Return - - - -Return12->Start2:p0 - - -0 - - - -Return12->Add11 - - -1 - - - -Scope1_0 - - -0 - -$ctrl - -arg - - - -Scope1_0:Scope1_0_arg->Start2:p1 - - - - - -Scope1_1 - - -1 - - - +#1[1] → #5 · ASSOC · 0: arg#11[1] → #5 · DATA#11[2] → #10 · DATA#12[0] → #4 · CTRL#12[1] → #11 · DATAScope  #1#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #5 ASSOC 0: arg0: $ctrl0: arg01Start  #2#2 Start +Type not computed + +$ctrl  #4/0#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRLarg  #5/1#5 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA#3  #10#10 #3 +Type not computed + ++  #11#11 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #10 DATA012Return  #12#12 Return +Type not computed + +[0] → #4 CTRL +[1] → #11 DATA01 diff --git a/chapter04/docs/04-pre-peephole.json b/chapter04/docs/04-pre-peephole.json new file mode 100644 index 00000000..839c16e7 --- /dev/null +++ b/chapter04/docs/04-pre-peephole.json @@ -0,0 +1,20 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-pre-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 10, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-pre-peephole.svg b/chapter04/docs/04-pre-peephole.svg index 9ec38d27..5ad17b13 100644 --- a/chapter04/docs/04-pre-peephole.svg +++ b/chapter04/docs/04-pre-peephole.svg @@ -1,134 +1,98 @@ - - - - - - -chapter04 - - -cluster_Nodes - - - -cluster_Scope1_0 - - - -cluster_Scope1_1 - - - - -Start2 - - -Start - - - -$ctrl - -arg - - - -Con_5 - -#1 - - - -Con_6 - -#2 - - - -Add7 - -+ - - - -Add7->Start2:p1 - - -1 - - - -Add7->Con_6 - - -2 - - - -Add8 - -+ - - - -Add8->Con_5 - - -1 - - - -Add8->Add7 - - -2 - - - -Return9 - -Return - - - -Return9->Start2:p0 - - -0 - - - -Return9->Add8 - - -1 - - - -Scope1_0 - - -0 - -$ctrl - -arg - - - -Scope1_0:Scope1_0_arg->Start2:p1 - - - - - -Scope1_1 - - -1 - - - +#1[1] → #10 · ASSOC · 0: arg#7[1] → #10 · DATA#7[2] → #6 · DATA#8[1] → #5 · DATA#8[2] → #7 · DATA#9[0] → #4 · CTRL#9[1] → #8 · DATAScope  #1#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #10 ASSOC 0: arg0: $ctrl0: arg01Start  #2#2 Start +Type not computed + +$ctrl  #4/0#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL#1  #5#5 #1 +Type not computed + +#2  #6#6 #2 +Type not computed + ++  #7#7 + +Type not computed + +[0] → — DATA +[1] → #10 DATA +[2] → #6 DATA012+  #8#8 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #7 DATA012Return  #9#9 Return +Type not computed + +[0] → #4 CTRL +[1] → #8 DATA01arg  #10/1#10 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA diff --git a/chapter04/docs/Makefile b/chapter04/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter04/docs/Makefile +++ b/chapter04/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter04/docs/projnode.json b/chapter04/docs/projnode.json new file mode 100644 index 00000000..3d4d20cf --- /dev/null +++ b/chapter04/docs/projnode.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter04/docs/projnode.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/projnode.svg b/chapter04/docs/projnode.svg new file mode 100644 index 00000000..b1291cdb --- /dev/null +++ b/chapter04/docs/projnode.svg @@ -0,0 +1,74 @@ +Start  #2#2 Start +Type not computed + +$ctrl  #4/0#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRLarg  #6/1#6 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA -- cgit v1.2.3