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 --- chapter02/docs/02-demonstration-peephole.json | 14 ++ chapter02/docs/02-demonstration-peephole.svg | 127 +++++----- .../docs/02-demonstration-pre-peephole-nokill.json | 17 ++ .../docs/02-demonstration-pre-peephole-nokill.svg | 184 +++++++------- chapter02/docs/02-demonstration-pre-peephole.json | 16 ++ chapter02/docs/02-demonstration-pre-peephole.svg | 168 +++++++------ chapter02/docs/02-post-peephole-ex1.json | 14 ++ chapter02/docs/02-post-peephole-ex1.svg | 129 +++++----- chapter02/docs/02-pre-peephole-ex1.json | 21 ++ chapter02/docs/02-pre-peephole-ex1.svg | 269 ++++++++------------- chapter02/docs/Makefile | 13 +- 11 files changed, 495 insertions(+), 477 deletions(-) create mode 100644 chapter02/docs/02-demonstration-peephole.json create mode 100644 chapter02/docs/02-demonstration-pre-peephole-nokill.json create mode 100644 chapter02/docs/02-demonstration-pre-peephole.json create mode 100644 chapter02/docs/02-post-peephole-ex1.json create mode 100644 chapter02/docs/02-pre-peephole-ex1.json (limited to 'chapter02/docs') diff --git a/chapter02/docs/02-demonstration-peephole.json b/chapter02/docs/02-demonstration-peephole.json new file mode 100644 index 00000000..f78a058e --- /dev/null +++ b/chapter02/docs/02-demonstration-peephole.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-demonstration-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 5, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-demonstration-peephole.svg b/chapter02/docs/02-demonstration-peephole.svg index 90ab6ca4..dfc03cff 100644 --- a/chapter02/docs/02-demonstration-peephole.svg +++ b/chapter02/docs/02-demonstration-peephole.svg @@ -1,54 +1,73 @@ - - - - - - -chapter02 - - -cluster_Nodes - - - - -Start1 - -Start - - - -Con_5 - -#3 - - - -Con_5->Start1 - - -0 - - - -Return6 - -Return - - - -Return6->Start1 - - -0 - - - -Return6->Con_5 - - -1 - - - \ No newline at end of file +#5[0] → #1 · ASSOC#6[0] → #1 · CTRL#6[1] → #5 · DATAStart  #1#1 Start +Type not computed + +#3  #5#5 #3 +Type not computed + +[0] → #1 ASSOC0Return  #6#6 Return +Type not computed + +[0] → #1 CTRL +[1] → #5 DATA01 diff --git a/chapter02/docs/02-demonstration-pre-peephole-nokill.json b/chapter02/docs/02-demonstration-pre-peephole-nokill.json new file mode 100644 index 00000000..6a952f88 --- /dev/null +++ b/chapter02/docs/02-demonstration-pre-peephole-nokill.json @@ -0,0 +1,17 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-demonstration-pre-peephole-nokill.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}, {"idx": 2, "def": 3, "role": "DATA", "label": null}], "proj": null}, + {"id": 5, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-demonstration-pre-peephole-nokill.svg b/chapter02/docs/02-demonstration-pre-peephole-nokill.svg index 3d4f53df..a40e5981 100644 --- a/chapter02/docs/02-demonstration-pre-peephole-nokill.svg +++ b/chapter02/docs/02-demonstration-pre-peephole-nokill.svg @@ -1,100 +1,84 @@ - - - - - - -chapter02 - - -cluster_Nodes - - - - -Start1 - -Start - - - -Con_2 - -#1 - - - -Con_2->Start1 - - -0 - - - -Con_3 - -#2 - - - -Con_3->Start1 - - -0 - - - -Add4 - -+ - - - -Add4->Con_2 - - -1 - - - -Add4->Con_3 - - -2 - - - -Con_5 - -#3 - - - -Con_5->Start1 - - -0 - - - -Return6 - -Return - - - -Return6->Start1 - - -0 - - - -Return6->Con_5 - - -1 - - - \ No newline at end of file +#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[1] → #2 · DATA#4[2] → #3 · DATA#5[0] → #1 · ASSOC#6[0] → #1 · CTRL#6[1] → #5 · DATAStart  #1#1 Start +Type not computed + +#1  #2#2 #1 +Type not computed + +[0] → #1 ASSOC0#2  #3#3 #2 +Type not computed + +[0] → #1 ASSOC0+  #4#4 + +Type not computed + +[0] → — DATA +[1] → #2 DATA +[2] → #3 DATA012#3  #5#5 #3 +Type not computed + +[0] → #1 ASSOC0Return  #6#6 Return +Type not computed + +[0] → #1 CTRL +[1] → #5 DATA01 diff --git a/chapter02/docs/02-demonstration-pre-peephole.json b/chapter02/docs/02-demonstration-pre-peephole.json new file mode 100644 index 00000000..b29cf6dd --- /dev/null +++ b/chapter02/docs/02-demonstration-pre-peephole.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-demonstration-pre-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}, {"idx": 2, "def": 3, "role": "DATA", "label": null}], "proj": null}, + {"id": 5, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-demonstration-pre-peephole.svg b/chapter02/docs/02-demonstration-pre-peephole.svg index 49624652..8809a0c0 100644 --- a/chapter02/docs/02-demonstration-pre-peephole.svg +++ b/chapter02/docs/02-demonstration-pre-peephole.svg @@ -1,87 +1,81 @@ - - - - - - -chapter02 - - -cluster_Nodes - - - - -Start1 - -Start - - - -Con_2 - -#1 - - - -Con_2->Start1 - - -0 - - - -Con_3 - -#2 - - - -Con_3->Start1 - - -0 - - - -Add4 - -+ - - - -Add4->Con_2 - - -1 - - - -Add4->Con_3 - - -2 - - - -Return5 - -Return - - - -Return5->Start1 - - -0 - - - -Return5->Add4 - - -1 - - - \ No newline at end of file +#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[1] → #2 · DATA#4[2] → #3 · DATA#5[0] → #1 · CTRL#5[1] → #4 · DATAStart  #1#1 Start +Type not computed + +#1  #2#2 #1 +Type not computed + +[0] → #1 ASSOC0#2  #3#3 #2 +Type not computed + +[0] → #1 ASSOC0+  #4#4 + +Type not computed + +[0] → — DATA +[1] → #2 DATA +[2] → #3 DATA012Return  #5#5 Return +Type not computed + +[0] → #1 CTRL +[1] → #4 DATA01 diff --git a/chapter02/docs/02-post-peephole-ex1.json b/chapter02/docs/02-post-peephole-ex1.json new file mode 100644 index 00000000..e9c6d1eb --- /dev/null +++ b/chapter02/docs/02-post-peephole-ex1.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-post-peephole-ex1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 14, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-post-peephole-ex1.svg b/chapter02/docs/02-post-peephole-ex1.svg index db27e30d..6674839e 100644 --- a/chapter02/docs/02-post-peephole-ex1.svg +++ b/chapter02/docs/02-post-peephole-ex1.svg @@ -1,56 +1,73 @@ - - - - - - -chapter02 - - -cluster_Nodes - - - - -Start1 - -Start - - - -Con_13 - -#2 - - - -Con_13->Start1 - - -0 - - - -Return14 - -Return - - - -Return14->Start1 - - -0 - - - -Return14->Con_13 - - -1 - - - +#13[0] → #1 · ASSOC#14[0] → #1 · CTRL#14[1] → #13 · DATAStart  #1#1 Start +Type not computed + +#2  #13#13 #2 +Type not computed + +[0] → #1 ASSOC0Return  #14#14 Return +Type not computed + +[0] → #1 CTRL +[1] → #13 DATA01 diff --git a/chapter02/docs/02-pre-peephole-ex1.json b/chapter02/docs/02-pre-peephole-ex1.json new file mode 100644 index 00000000..012bd814 --- /dev/null +++ b/chapter02/docs/02-pre-peephole-ex1.json @@ -0,0 +1,21 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-pre-peephole-ex1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 5, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 3, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 6, "label": "#5", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "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": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-pre-peephole-ex1.svg b/chapter02/docs/02-pre-peephole-ex1.svg index 29c76bd8..e2e5f785 100644 --- a/chapter02/docs/02-pre-peephole-ex1.svg +++ b/chapter02/docs/02-pre-peephole-ex1.svg @@ -1,168 +1,101 @@ - - - - - - -chapter02 - - -cluster_Nodes - - - - -Start1 - -Start - - - -Con_2 - -#1 - - - -Con_2->Start1 - - -0 - - - -Con_3 - -#2 - - - -Con_3->Start1 - - -0 - - - -Con_4 - -#3 - - - -Con_4->Start1 - - -0 - - - -Mul5 - -* - - - -Mul5->Con_3 - - -1 - - - -Mul5->Con_4 - - -2 - - - -Con_6 - -#5 - - - -Con_6->Start1 - - -0 - - - -Minus7 - -- - - - -Minus7->Con_6 - - -1 - - - -Add8 - -+ - - - -Add8->Mul5 - - -1 - - - -Add8->Minus7 - - -2 - - - -Add9 - -+ - - - -Add9->Con_2 - - -1 - - - -Add9->Add8 - - -2 - - - -Return10 - -Return - - - -Return10->Start1 - - -0 - - - -Return10->Add9 - - -1 - - - +#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[0] → #1 · ASSOC#5[1] → #3 · DATA#5[2] → #4 · DATA#6[0] → #1 · ASSOC#7[1] → #6 · DATA#8[1] → #5 · DATA#8[2] → #7 · DATA#9[1] → #2 · DATA#9[2] → #8 · DATA#10[0] → #1 · CTRL#10[1] → #9 · DATAStart  #1#1 Start +Type not computed + +#1  #2#2 #1 +Type not computed + +[0] → #1 ASSOC0#2  #3#3 #2 +Type not computed + +[0] → #1 ASSOC0#3  #4#4 #3 +Type not computed + +[0] → #1 ASSOC0*  #5#5 * +Type not computed + +[0] → — DATA +[1] → #3 DATA +[2] → #4 DATA012#5  #6#6 #5 +Type not computed + +[0] → #1 ASSOC0-  #7#7 - +Type not computed + +[0] → — DATA +[1] → #6 DATA01+  #8#8 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #7 DATA012+  #9#9 + +Type not computed + +[0] → — DATA +[1] → #2 DATA +[2] → #8 DATA012Return  #10#10 Return +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA01 diff --git a/chapter02/docs/Makefile b/chapter02/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter02/docs/Makefile +++ b/chapter02/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 -- cgit v1.2.3