From 22df891893d30e9906d0b14fc3ae5d8e67d500b2 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 3 Oct 2026 14:03:48 -0700 Subject: Chapter renumber, and split ch 17 Renumber chapters 10a, 10b, 11, 12, 13, 14 -> 10, 11, 13, 12, [11,14]. Split ch 17 into a 17a and 17b; shuffle around im/mutable syntax to be consistent, and present it more slowly. THe new immutable syntax is pushed through all later chapters --- chapter13/docs/13-grammar.md | 11 ++-- chapter13/docs/Makefile | 13 +--- chapter13/docs/graph1.gv | 79 +++++++++++++++++++++++++ chapter13/docs/graph1.json | 25 ++++++++ chapter13/docs/graph1.svg | 123 ++++++++++++++++++++++++++++++++++++++ chapter13/docs/graph2.gv | 84 ++++++++++++++++++++++++++ chapter13/docs/graph2.json | 25 ++++++++ chapter13/docs/graph2.svg | 123 ++++++++++++++++++++++++++++++++++++++ chapter13/docs/graph3-snip.jpg | Bin 0 -> 19681 bytes chapter13/docs/graph3-snip.json | 17 ++++++ chapter13/docs/graph3-snip.svg | 91 ++++++++++++++++++++++++++++ chapter13/docs/graph3.gv | 85 ++++++++++++++++++++++++++ chapter13/docs/graph3.json | 26 ++++++++ chapter13/docs/graph3.svg | 128 ++++++++++++++++++++++++++++++++++++++++ chapter13/docs/graph4.gv | 110 ++++++++++++++++++++++++++++++++++ chapter13/docs/graph4.json | 24 ++++++++ chapter13/docs/graph4.svg | 120 +++++++++++++++++++++++++++++++++++++ chapter13/docs/graph5.gv | 117 ++++++++++++++++++++++++++++++++++++ chapter13/docs/graph5.json | 24 ++++++++ chapter13/docs/graph5.svg | 120 +++++++++++++++++++++++++++++++++++++ chapter13/docs/graph6.gv | 117 ++++++++++++++++++++++++++++++++++++ chapter13/docs/graph6.json | 25 ++++++++ chapter13/docs/graph6.svg | 124 ++++++++++++++++++++++++++++++++++++++ chapter13/docs/graph7.gv | 23 ++++++++ chapter13/docs/graph7.json | 16 +++++ chapter13/docs/graph7.svg | 78 ++++++++++++++++++++++++ chapter13/docs/graph8.gv | 45 ++++++++++++++ chapter13/docs/graph8.json | 21 +++++++ chapter13/docs/graph8.svg | 98 ++++++++++++++++++++++++++++++ 29 files changed, 1874 insertions(+), 18 deletions(-) create mode 100644 chapter13/docs/graph1.gv create mode 100644 chapter13/docs/graph1.json create mode 100644 chapter13/docs/graph1.svg create mode 100644 chapter13/docs/graph2.gv create mode 100644 chapter13/docs/graph2.json create mode 100644 chapter13/docs/graph2.svg create mode 100644 chapter13/docs/graph3-snip.jpg create mode 100644 chapter13/docs/graph3-snip.json create mode 100644 chapter13/docs/graph3-snip.svg create mode 100644 chapter13/docs/graph3.gv create mode 100644 chapter13/docs/graph3.json create mode 100644 chapter13/docs/graph3.svg create mode 100644 chapter13/docs/graph4.gv create mode 100644 chapter13/docs/graph4.json create mode 100644 chapter13/docs/graph4.svg create mode 100644 chapter13/docs/graph5.gv create mode 100644 chapter13/docs/graph5.json create mode 100644 chapter13/docs/graph5.svg create mode 100644 chapter13/docs/graph6.gv create mode 100644 chapter13/docs/graph6.json create mode 100644 chapter13/docs/graph6.svg create mode 100644 chapter13/docs/graph7.gv create mode 100644 chapter13/docs/graph7.json create mode 100644 chapter13/docs/graph7.svg create mode 100644 chapter13/docs/graph8.gv create mode 100644 chapter13/docs/graph8.json create mode 100644 chapter13/docs/graph8.svg (limited to 'chapter13/docs') diff --git a/chapter13/docs/13-grammar.md b/chapter13/docs/13-grammar.md index 6cbbf388..4e7ae5b4 100644 --- a/chapter13/docs/13-grammar.md +++ b/chapter13/docs/13-grammar.md @@ -11,22 +11,21 @@ statement : returnStatement | structDeclaration | declStatement - | blockStatment + | blockStatement | expressionStatement | ifStatement | whileStatement | breakStatement - | continueStatment + | continueStatement ; PRIMTYPE : 'int' - | 'flt' ; field : PRIMTYPE IDENTIFIER ';' - | structName IDENTIFIER ('?')? ';' + | structName ('?')? IDENTIFIER ';' ; fields @@ -103,7 +102,7 @@ newExpression ; fieldExpression - : primaryExpresson '.' IDENTIFIER + : primaryExpression '.' IDENTIFIER ; primaryExpression @@ -123,7 +122,7 @@ INTEGER_LITERAL ; IDENTIFIER - : NON_DIGIT (NON_DIGIT | DIGIT)* + : NON_DIGIT (NON_DIGIT | DEC_DIGIT)* ; NON_DIGIT: [a-zA-Z_]; diff --git a/chapter13/docs/Makefile b/chapter13/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter13/docs/Makefile +++ b/chapter13/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/chapter13/docs/graph1.gv b/chapter13/docs/graph1.gv new file mode 100644 index 00000000..4d6ee1fe --- /dev/null +++ b/chapter13/docs/graph1.gv @@ -0,0 +1,79 @@ +digraph chapter13 { +/* +struct S { int f; } +S v=new S; +v.f = 2; +int i=new S.f; +i=v.f; +if (arg) v.f=1; +return i; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$memarg
+
> + ]; + MemMerge [ shape=box label="MemMerge" ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + new9 [ label="new S" ]; + Con_11 [ label="#2" ]; + Store12 [ label=".f =" ]; + new13 [ label="new S" ]; + Store14 [ label=".f =" ]; + Load16 [ label=".f" ]; + If17 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Con_21 [ label="#1" ]; + Store22 [ label=".f =" ]; + Region23 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_224 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Return25 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Region23;Phi_224;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return25[taillabel=0 color=red]; + new9 -> Start2:p0[taillabel=0 color=green]; + Store12 -> Start2:p1[taillabel=1 color=blue]; + Store12 -> new9[taillabel=2]; + Store12 -> Con_11[taillabel=3]; + new13 -> Start2:p0[taillabel=0 color=green]; + Store14 -> Store12[taillabel=1 color=blue]; + Store14 -> new13[taillabel=2]; + Store14 -> Con_4[taillabel=3]; + Load16 -> Store14[taillabel=1 color=blue]; + Load16 -> new9[taillabel=2]; + If17 -> Start2:p0[taillabel=0 color=red]; + If17 -> Start2:p2[taillabel=1]; + Store22 -> Store14[taillabel=1 color=blue]; + Store22 -> new9[taillabel=2]; + Store22 -> Con_21[taillabel=3]; + Region23 -> If17:p0[taillabel=1 color=red]; + Region23 -> If17:p1[taillabel=2 color=red]; + Phi_224 -> Region23 [style=dotted taillabel=0]; + Phi_224 -> Store22[taillabel=1 color=blue]; + Phi_224 -> Store14[taillabel=2 color=blue constraint=false]; + Return25 -> Region23[taillabel=0 color=red]; + Return25 -> Load16[taillabel=2]; + Return25 -> MemMerge[taillabel=1 color=blue]; + MemMerge -> Start2:p1[taillabel=1 color=blue]; + MemMerge -> Phi_224[taillabel=2 color=blue]; +} diff --git a/chapter13/docs/graph1.json b/chapter13/docs/graph1.json new file mode 100644 index 00000000..aac69ce2 --- /dev/null +++ b/chapter13/docs/graph1.json @@ -0,0 +1,25 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph1.svg", + "step": 1, + "roots": [25], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 224, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 224, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph1.svg b/chapter13/docs/graph1.svg new file mode 100644 index 00000000..93a2a03f --- /dev/null +++ b/chapter13/docs/graph1.svg @@ -0,0 +1,123 @@ +#1[1] → #6 · MEM#1[2] → #224 · MEM#12[1] → #6 · MEM#12[2] → #9 · DATA#12[3] → #11 · DATA#14[1] → #12 · MEM#14[2] → #13 · DATA#14[3] → #4 · DATA#16[1] → #14 · MEM#16[2] → #9 · DATA#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#25[1] → #1 · MEM#25[2] → #16 · DATA#224[1] → #22 · MEM#224[2] → #14 · MEMMemMerge  #1#1 MemMerge +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #224 MEM012Start  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +$mem  #6/1#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEMnew S  #9#9 new S +Type not computed + +[0] → — CTRL0#2  #11#11 #2 +Type not computed + +.f =  #12#12 .f = +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #9 DATA +[3] → #11 DATA0123new S  #13#13 new S +Type not computed + +[0] → — CTRL0.f =  #14#14 .f = +Type not computed + +[0] → — DATA +[1] → #12 MEM +[2] → #13 DATA +[3] → #4 DATA0123.f  #16#16 .f +Type not computed + +[0] → — DATA +[1] → #14 MEM +[2] → #9 DATA012#1  #21#21 #1 +Type not computed + +.f =  #22#22 .f = +Type not computed + +[0] → — DATA +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA0123Return  #25#25 Return +Type not computed + +[0] → — CTRL +[1] → #1 MEM +[2] → #16 DATA012MemPhi_2  #224#224 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #22 MEM +[2] → #14 MEM012 diff --git a/chapter13/docs/graph2.gv b/chapter13/docs/graph2.gv new file mode 100644 index 00000000..94d94dae --- /dev/null +++ b/chapter13/docs/graph2.gv @@ -0,0 +1,84 @@ +digraph chapter13 { +/* +struct S { int f; } +S v=new S; +v.f = 2; +int i=new S.f; +i=v.f; +if (arg) v.f=1; +return i; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$memarg
+
> + ]; + MemMerge [ shape=box label="MemMerge" ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + new9 [ label="new S" ]; + Con_11 [ label="#2" ]; + Store12 [ label=".f =" ]; + new13 [ label="new S" ]; + Store14 [ label=".f =" ]; + Load16 [ label=".f" ]; + If17 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Con_21 [ label="#1" ]; + Store22 [ label=".f =" ]; + Region23 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_224 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Return25 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Region23;Phi_224;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return25[taillabel=0 color=red]; + new9 -> Start2:p0[taillabel=0 color=green]; + Store12 -> Start2:p0[taillabel=0 color=red]; + Store12 -> Start2:p1[taillabel=1 color=blue]; + Store12 -> new9[taillabel=2]; + Store12 -> Con_11[taillabel=3]; + new13 -> Start2:p0[taillabel=0 color=green]; + Store14 -> Start2:p0[taillabel=0 color=red]; + Store14 -> Store12[taillabel=1 color=blue]; + Store14 -> new13[taillabel=2]; + Store14 -> Con_4[taillabel=3]; + Load16 -> Start2:p0[taillabel=0 color=red]; + Load16 -> Store14[taillabel=1 color=blue]; + Load16 -> new9[taillabel=2]; + If17 -> Start2:p0[taillabel=0 color=red]; + If17 -> Start2:p2[taillabel=1]; + Store22 -> Start2:p0[taillabel=0 color=red]; + Store22 -> Store14[taillabel=1 color=blue]; + Store22 -> new9[taillabel=2]; + Store22 -> Con_21[taillabel=3]; + Region23 -> If17:p0[taillabel=1 color=red]; + Region23 -> If17:p1[taillabel=2 color=red]; + Phi_224 -> Region23 [style=dotted taillabel=0]; + Phi_224 -> Store22[taillabel=1 color=blue]; + Phi_224 -> Store14[taillabel=2 color=blue constraint=false]; + Return25 -> Region23[taillabel=0 color=red]; + Return25 -> Load16[taillabel=2]; + Return25 -> MemMerge[taillabel=1 color=blue]; + MemMerge -> Start2:p1[taillabel=1 color=blue]; + MemMerge -> Phi_224[taillabel=2 color=blue]; + MemMerge -> Region23[taillabel=0 color=green]; +} diff --git a/chapter13/docs/graph2.json b/chapter13/docs/graph2.json new file mode 100644 index 00000000..47689c72 --- /dev/null +++ b/chapter13/docs/graph2.json @@ -0,0 +1,25 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph2.svg", + "step": 1, + "roots": [25], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 224, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 224, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph2.svg b/chapter13/docs/graph2.svg new file mode 100644 index 00000000..05210749 --- /dev/null +++ b/chapter13/docs/graph2.svg @@ -0,0 +1,123 @@ +#1[1] → #6 · MEM#1[2] → #224 · MEM#12[1] → #6 · MEM#12[2] → #9 · DATA#12[3] → #11 · DATA#14[1] → #12 · MEM#14[2] → #13 · DATA#14[3] → #4 · DATA#16[1] → #14 · MEM#16[2] → #9 · DATA#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#25[1] → #1 · MEM#25[2] → #16 · DATA#224[1] → #22 · MEM#224[2] → #14 · MEMMemMerge  #1#1 MemMerge +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #224 MEM012Start  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +$mem  #6/1#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEMnew S  #9#9 new S +Type not computed + +[0] → — CTRL0#2  #11#11 #2 +Type not computed + +.f =  #12#12 .f = +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #11 DATA0123new S  #13#13 new S +Type not computed + +[0] → — CTRL0.f =  #14#14 .f = +Type not computed + +[0] → — CTRL +[1] → #12 MEM +[2] → #13 DATA +[3] → #4 DATA0123.f  #16#16 .f +Type not computed + +[0] → — CTRL +[1] → #14 MEM +[2] → #9 DATA012#1  #21#21 #1 +Type not computed + +.f =  #22#22 .f = +Type not computed + +[0] → — CTRL +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA0123Return  #25#25 Return +Type not computed + +[0] → — CTRL +[1] → #1 MEM +[2] → #16 DATA012MemPhi_2  #224#224 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #22 MEM +[2] → #14 MEM012 diff --git a/chapter13/docs/graph3-snip.jpg b/chapter13/docs/graph3-snip.jpg new file mode 100644 index 00000000..804a32c4 Binary files /dev/null and b/chapter13/docs/graph3-snip.jpg differ diff --git a/chapter13/docs/graph3-snip.json b/chapter13/docs/graph3-snip.json new file mode 100644 index 00000000..548dbdf3 --- /dev/null +++ b/chapter13/docs/graph3-snip.json @@ -0,0 +1,17 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph3-snip.svg", + "step": 1, + "roots": [22], + "scope": 0, + "nodes": [ + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 0, "role": "MEM", "label": null}, {"idx": 2, "def": 0, "role": "DATA", "label": null}, {"idx": 3, "def": 0, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}, {"idx": 4, "def": 16, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph3-snip.svg b/chapter13/docs/graph3-snip.svg new file mode 100644 index 00000000..9f5218af --- /dev/null +++ b/chapter13/docs/graph3-snip.svg @@ -0,0 +1,91 @@ +#16[1] → #14 · MEM#16[2] → #9 · DATA#22[0] → #8 · CTRL#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#22[4] → #16 · DATATrue  #8/0#8 True +Projection 0 of #0 +Type not computed + +new S  #9#9 new S +Type not computed + +[0] → — CTRL0.f =  #14#14 .f = +Type not computed + +[0] → — CTRL +[1] → — MEM +[2] → — DATA +[3] → — DATA0123.f  #16#16 .f +Type not computed + +[0] → — CTRL +[1] → #14 MEM +[2] → #9 DATA012#1  #21#21 #1 +Type not computed + +.f =  #22#22 .f = +Type not computed + +[0] → #8 CTRL +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA +[4] → #16 DATA01234 diff --git a/chapter13/docs/graph3.gv b/chapter13/docs/graph3.gv new file mode 100644 index 00000000..53c9aafe --- /dev/null +++ b/chapter13/docs/graph3.gv @@ -0,0 +1,85 @@ +digraph chapter13 { +/* +struct S { int f; } +S v=new S; +v.f = 2; +int i=new S.f; +i=v.f; +if (arg) v.f=1; +return i; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$memarg
+
> + ]; + MemMerge [ shape=box label="MemMerge" ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + new9 [ label="new S" ]; + Con_11 [ label="#2" ]; + Store12 [ label=".f =" ]; + new13 [ label="new S" ]; + Store14 [ label=".f =" ]; + Load16 [ label=".f" ]; + If17 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Con_21 [ label="#1" ]; + Store22 [ label=".f =" ]; + Region23 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_224 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Return25 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Region23;Phi_224;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return25[taillabel=0 color=red]; + new9 -> Start2:p0[taillabel=0 color=green]; + Store12 -> Start2:p0[taillabel=0 color=red]; + Store12 -> Start2:p1[taillabel=1 color=blue]; + Store12 -> new9[taillabel=2]; + Store12 -> Con_11[taillabel=3]; + new13 -> Start2:p0[taillabel=0 color=green]; + Store14 -> Start2:p0[taillabel=0 color=red]; + Store14 -> Store12[taillabel=1 color=blue]; + Store14 -> new13[taillabel=2]; + Store14 -> Con_4[taillabel=3]; + Load16 -> Start2:p0[taillabel=0 color=red]; + Load16 -> Store14[taillabel=1 color=blue]; + Load16 -> new9[taillabel=2]; + If17 -> Start2:p0[taillabel=0 color=red]; + If17 -> Start2:p2[taillabel=1]; + Store22 -> If17:p0[taillabel=0 color=red]; + Store22 -> Store14[taillabel=1 color=blue]; + Store22 -> new9[taillabel=2]; + Store22 -> Con_21[taillabel=3]; + Store22 -> Load16[taillabel=4]; + Region23 -> If17:p0[taillabel=1 color=red]; + Region23 -> If17:p1[taillabel=2 color=red]; + Phi_224 -> Region23 [style=dotted taillabel=0]; + Phi_224 -> Store22[taillabel=1 color=blue]; + Phi_224 -> Store14[taillabel=2 color=blue constraint=false]; + Return25 -> Region23[taillabel=0 color=red]; + Return25 -> Load16[taillabel=2]; + Return25 -> MemMerge[taillabel=1 color=blue]; + MemMerge -> Start2:p1[taillabel=1 color=blue]; + MemMerge -> Phi_224[taillabel=2 color=blue]; + MemMerge -> Region23[taillabel=0 color=green]; +} diff --git a/chapter13/docs/graph3.json b/chapter13/docs/graph3.json new file mode 100644 index 00000000..e44eb1b1 --- /dev/null +++ b/chapter13/docs/graph3.json @@ -0,0 +1,26 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph3.svg", + "step": 1, + "roots": [25], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 224, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}, {"idx": 4, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 224, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph3.svg b/chapter13/docs/graph3.svg new file mode 100644 index 00000000..0247b5c6 --- /dev/null +++ b/chapter13/docs/graph3.svg @@ -0,0 +1,128 @@ +#1[1] → #6 · MEM#1[2] → #224 · MEM#12[1] → #6 · MEM#12[2] → #9 · DATA#12[3] → #11 · DATA#14[1] → #12 · MEM#14[2] → #13 · DATA#14[3] → #4 · DATA#16[1] → #14 · MEM#16[2] → #9 · DATA#22[0] → #8 · CTRL#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#22[4] → #16 · DATA#25[1] → #1 · MEM#25[2] → #16 · DATA#224[1] → #22 · MEM#224[2] → #14 · MEMMemMerge  #1#1 MemMerge +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #224 MEM012Start  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +$mem  #6/1#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEMTrue  #8/0#8 True +Projection 0 of #0 +Type not computed + +new S  #9#9 new S +Type not computed + +[0] → — CTRL0#2  #11#11 #2 +Type not computed + +.f =  #12#12 .f = +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #11 DATA0123new S  #13#13 new S +Type not computed + +[0] → — CTRL0.f =  #14#14 .f = +Type not computed + +[0] → — CTRL +[1] → #12 MEM +[2] → #13 DATA +[3] → #4 DATA0123.f  #16#16 .f +Type not computed + +[0] → — CTRL +[1] → #14 MEM +[2] → #9 DATA012#1  #21#21 #1 +Type not computed + +.f =  #22#22 .f = +Type not computed + +[0] → #8 CTRL +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA +[4] → #16 DATA01234Return  #25#25 Return +Type not computed + +[0] → — CTRL +[1] → #1 MEM +[2] → #16 DATA012MemPhi_2  #224#224 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #22 MEM +[2] → #14 MEM012 diff --git a/chapter13/docs/graph4.gv b/chapter13/docs/graph4.gv new file mode 100644 index 00000000..d7082072 --- /dev/null +++ b/chapter13/docs/graph4.gv @@ -0,0 +1,110 @@ +digraph chapter13 { +/* +struct S { int f; } +S v = new S; +int i = arg; +while (arg > 0) { + int j = i/3; + if (arg == 5) + v.f = j; + arg = arg - 1; +} +return v; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$memarg
+
> + ]; + MemMerge [ shape=box label="MemMerge" ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + new9 [ label="new S" ]; + Store10 [ label=".f =" ]; + Loop11 [ shape=box style=filled fillcolor=yellow label="Loop" ]; + Phi_arg13 [ style=filled fillcolor=lightyellow label="φ_arg" ]; + LT14 [ label="<" ]; + If16 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Div21 [ label="//" ]; + Con_22 [ label="#3" ]; + EQ23 [ label="==" ]; + Con_24 [ label="#5" ]; + If25 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Phi_230 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Store31 [ label=".f =" ]; + Region32 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_233 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Sub35 [ label="-" ]; + Con_36 [ label="#1" ]; + Return37 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Loop11;Phi_230;Phi_arg13;} + { rank=same; Region32;Phi_233;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return37[taillabel=0 color=red]; + new9 -> Start2:p0[taillabel=0 color=green]; + Store10 -> Start2:p1[taillabel=1 color=blue]; + Store10 -> new9[taillabel=2]; + Store10 -> Con_4[taillabel=3]; + Loop11 -> Start2:p0[taillabel=1 color=red]; + Loop11 -> Region32[taillabel=2 color=red constraint=false]; + Phi_arg13 -> Loop11 [style=dotted taillabel=0]; + Phi_arg13 -> Start2:p2[taillabel=1]; + Phi_arg13 -> Sub35[taillabel=2 constraint=false]; + LT14 -> Con_4[taillabel=1]; + LT14 -> Phi_arg13[taillabel=2]; + If16 -> Loop11[taillabel=0 color=red]; + If16 -> LT14[taillabel=1]; + Div21 -> Start2:p2[taillabel=1]; + Div21 -> Con_22[taillabel=2]; + EQ23 -> Phi_arg13[taillabel=1]; + EQ23 -> Con_24[taillabel=2]; + If25 -> If16:p0[taillabel=0 color=red]; + If25 -> EQ23[taillabel=1]; + Phi_230 -> Loop11 [style=dotted taillabel=0]; + Phi_230 -> Store10[taillabel=1 color=blue]; + Phi_230 -> Phi_233[taillabel=2 color=blue constraint=false]; + Store31 -> Phi_230[taillabel=1 color=blue]; + Store31 -> new9[taillabel=2]; + Store31 -> Div21[taillabel=3]; + Region32 -> If25:p0[taillabel=1 color=red]; + Region32 -> If25:p1[taillabel=2 color=red]; + Phi_233 -> Region32 [style=dotted taillabel=0]; + Phi_233 -> Store31[taillabel=1 color=blue]; + Phi_233 -> Phi_230[taillabel=2 color=blue constraint=false]; + Sub35 -> Phi_arg13[taillabel=1]; + Sub35 -> Con_36[taillabel=2]; + Return37 -> If16:p1[taillabel=0 color=red]; + Return37 -> new9[taillabel=2]; + Return37 -> MemMerge[taillabel=1 color=blue]; + MemMerge -> Start2:p1[taillabel=1 color=blue]; + MemMerge -> Phi_230[taillabel=2 color=blue]; +} diff --git a/chapter13/docs/graph4.json b/chapter13/docs/graph4.json new file mode 100644 index 00000000..add08b6b --- /dev/null +++ b/chapter13/docs/graph4.json @@ -0,0 +1,24 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph4.svg", + "step": 1, + "roots": [37], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 230, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 230, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 233, "role": "MEM", "label": null}], "proj": null}, + {"id": 233, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph4.svg b/chapter13/docs/graph4.svg new file mode 100644 index 00000000..9ca92879 --- /dev/null +++ b/chapter13/docs/graph4.svg @@ -0,0 +1,120 @@ +#1[1] → #6 · MEM#1[2] → #230 · MEM#10[1] → #6 · MEM#10[2] → #9 · DATA#10[3] → #4 · DATA#21[1] → #7 · DATA#21[2] → #22 · DATA#31[1] → #230 · MEM#31[2] → #9 · DATA#31[3] → #21 · DATA#37[1] → #1 · MEM#37[2] → #9 · DATA#230[1] → #10 · MEM#230[2] → #233 · MEM#233[1] → #31 · MEM#233[2] → #230 · MEMMemMerge  #1#1 MemMerge +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #230 MEM012Start  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +$mem  #6/1#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEMarg  #7/2#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATAnew S  #9#9 new S +Type not computed + +[0] → — CTRL0.f =  #10#10 .f = +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #9 DATA +[3] → #4 DATA0123//  #21#21 // +Type not computed + +[0] → — DATA +[1] → #7 DATA +[2] → #22 DATA012#3  #22#22 #3 +Type not computed + +.f =  #31#31 .f = +Type not computed + +[0] → — DATA +[1] → #230 MEM +[2] → #9 DATA +[3] → #21 DATA0123Return  #37#37 Return +Type not computed + +[0] → — CTRL +[1] → #1 MEM +[2] → #9 DATA012MemPhi_2  #230#230 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #10 MEM +[2] → #233 MEM012MemPhi_2  #233#233 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #31 MEM +[2] → #230 MEM012 diff --git a/chapter13/docs/graph5.gv b/chapter13/docs/graph5.gv new file mode 100644 index 00000000..8189f6dd --- /dev/null +++ b/chapter13/docs/graph5.gv @@ -0,0 +1,117 @@ +digraph chapter13 { +/* +struct S { int f; } +S v = new S; +int i = arg; +while (arg > 0) { + int j = i/3; + if (arg == 5) + v.f = j; + arg = arg - 1; +} +return v; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$memarg
+
> + ]; + MemMerge [ shape=box label="MemMerge" ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + new9 [ label="new S" ]; + Store10 [ label=".f =" ]; + Loop11 [ shape=box style=filled fillcolor=yellow label="Loop" ]; + Phi_arg13 [ style=filled fillcolor=lightyellow label="φ_arg" ]; + LT14 [ label="<" ]; + If16 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Div21 [ label="//" ]; + Con_22 [ label="#3" ]; + EQ23 [ label="==" ]; + Con_24 [ label="#5" ]; + If25 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Phi_230 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Store31 [ label=".f =" ]; + Region32 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_233 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Sub35 [ label="-" ]; + Con_36 [ label="#1" ]; + Return37 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Loop11;Phi_230;Phi_arg13;} + { rank=same; Region32;Phi_233;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return37[taillabel=0 color=red]; + new9 -> Start2:p0[taillabel=0 color=green]; + Store10 -> Start2:p0[taillabel=0 color=red]; + Store10 -> Start2:p1[taillabel=1 color=blue]; + Store10 -> new9[taillabel=2]; + Store10 -> Con_4[taillabel=3]; + Loop11 -> Start2:p0[taillabel=1 color=red]; + Loop11 -> Region32[taillabel=2 color=red constraint=false]; + Phi_arg13 -> Loop11 [style=dotted taillabel=0]; + Phi_arg13 -> Start2:p2[taillabel=1]; + Phi_arg13 -> Sub35[taillabel=2 constraint=false]; + LT14 -> Loop11[taillabel=0 color=red]; + LT14 -> Con_4[taillabel=1]; + LT14 -> Phi_arg13[taillabel=2]; + If16 -> Loop11[taillabel=0 color=red]; + If16 -> LT14[taillabel=1]; + Div21 -> Start2[taillabel=0 color=red]; + Div21 -> Start2:p2[taillabel=1]; + Div21 -> Con_22[taillabel=2]; + EQ23 -> Loop11[taillabel=0 color=red]; + EQ23 -> Phi_arg13[taillabel=1]; + EQ23 -> Con_24[taillabel=2]; + If25 -> If16:p0[taillabel=0 color=red]; + If25 -> EQ23[taillabel=1]; + Phi_230 -> Loop11 [style=dotted taillabel=0]; + Phi_230 -> Store10[taillabel=1 color=blue]; + Phi_230 -> Phi_233[taillabel=2 color=blue constraint=false]; + Store31 -> Loop11[taillabel=0 color=red]; + Store31 -> Phi_230[taillabel=1 color=blue]; + Store31 -> new9[taillabel=2]; + Store31 -> Div21[taillabel=3]; + Region32 -> If25:p0[taillabel=1 color=red]; + Region32 -> If25:p1[taillabel=2 color=red]; + Phi_233 -> Region32 [style=dotted taillabel=0]; + Phi_233 -> Store31[taillabel=1 color=blue]; + Phi_233 -> Phi_230[taillabel=2 color=blue constraint=false]; + Sub35 -> Loop11[taillabel=0 color=red]; + Sub35 -> Phi_arg13[taillabel=1]; + Sub35 -> Con_36[taillabel=2]; + Return37 -> If16:p1[taillabel=0 color=red]; + Return37 -> new9[taillabel=2]; + Return37 -> MemMerge[taillabel=1 color=blue]; + MemMerge -> Start2:p1[taillabel=1 color=blue]; + MemMerge -> Phi_230[taillabel=2 color=blue]; + MemMerge -> Loop11[taillabel=0 color=green]; +} diff --git a/chapter13/docs/graph5.json b/chapter13/docs/graph5.json new file mode 100644 index 00000000..6b1722f6 --- /dev/null +++ b/chapter13/docs/graph5.json @@ -0,0 +1,24 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph5.svg", + "step": 1, + "roots": [37], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 230, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 230, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 233, "role": "MEM", "label": null}], "proj": null}, + {"id": 233, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph5.svg b/chapter13/docs/graph5.svg new file mode 100644 index 00000000..c120550f --- /dev/null +++ b/chapter13/docs/graph5.svg @@ -0,0 +1,120 @@ +#1[1] → #6 · MEM#1[2] → #230 · MEM#10[1] → #6 · MEM#10[2] → #9 · DATA#10[3] → #4 · DATA#21[1] → #7 · DATA#21[2] → #22 · DATA#31[1] → #230 · MEM#31[2] → #9 · DATA#31[3] → #21 · DATA#37[1] → #1 · MEM#37[2] → #9 · DATA#230[1] → #10 · MEM#230[2] → #233 · MEM#233[1] → #31 · MEM#233[2] → #230 · MEMMemMerge  #1#1 MemMerge +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #230 MEM012Start  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +$mem  #6/1#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEMarg  #7/2#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATAnew S  #9#9 new S +Type not computed + +[0] → — CTRL0.f =  #10#10 .f = +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #4 DATA0123//  #21#21 // +Type not computed + +[0] → — CTRL +[1] → #7 DATA +[2] → #22 DATA012#3  #22#22 #3 +Type not computed + +.f =  #31#31 .f = +Type not computed + +[0] → — CTRL +[1] → #230 MEM +[2] → #9 DATA +[3] → #21 DATA0123Return  #37#37 Return +Type not computed + +[0] → — CTRL +[1] → #1 MEM +[2] → #9 DATA012MemPhi_2  #230#230 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #10 MEM +[2] → #233 MEM012MemPhi_2  #233#233 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #31 MEM +[2] → #230 MEM012 diff --git a/chapter13/docs/graph6.gv b/chapter13/docs/graph6.gv new file mode 100644 index 00000000..47165fdb --- /dev/null +++ b/chapter13/docs/graph6.gv @@ -0,0 +1,117 @@ +digraph chapter13 { +/* +struct S { int f; } +S v = new S; +int i = arg; +while (arg > 0) { + int j = i/3; + if (arg == 5) + v.f = j; + arg = arg - 1; +} +return v; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl$memarg
+
> + ]; + MemMerge [ shape=box label="MemMerge" ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + new9 [ label="new S" ]; + Store10 [ label=".f =" ]; + Loop11 [ shape=box style=filled fillcolor=yellow label="Loop" ]; + Phi_arg13 [ style=filled fillcolor=lightyellow label="φ_arg" ]; + LT14 [ label="<" ]; + If16 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Div21 [ label="//" ]; + Con_22 [ label="#3" ]; + EQ23 [ label="==" ]; + Con_24 [ label="#5" ]; + If25 [ shape=plaintext label=< + + + +
If
+ + +
TrueFalse
+
> + ]; + Phi_230 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Store31 [ label=".f =" ]; + Region32 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_233 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; + Sub35 [ label="-" ]; + Con_36 [ label="#1" ]; + Return37 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Loop11;Phi_230;Phi_arg13;} + { rank=same; Region32;Phi_233;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return37[taillabel=0 color=red]; + new9 -> Start2:p0[taillabel=0 color=green]; + Store10 -> Start2:p0[taillabel=0 color=red]; + Store10 -> Start2:p1[taillabel=1 color=blue]; + Store10 -> new9[taillabel=2]; + Store10 -> Con_4[taillabel=3]; + Loop11 -> Start2:p0[taillabel=1 color=red]; + Loop11 -> Region32[taillabel=2 color=red constraint=false]; + Phi_arg13 -> Loop11 [style=dotted taillabel=0]; + Phi_arg13 -> Start2:p2[taillabel=1]; + Phi_arg13 -> Sub35[taillabel=2 constraint=false]; + LT14 -> Loop11[taillabel=0 color=red]; + LT14 -> Con_4[taillabel=1]; + LT14 -> Phi_arg13[taillabel=2]; + If16 -> Loop11[taillabel=0 color=red]; + If16 -> LT14[taillabel=1]; + Div21 -> Start2:p0[taillabel=0 color=red]; + Div21 -> Start2:p2[taillabel=1]; + Div21 -> Con_22[taillabel=2]; + EQ23 -> If16:p0[taillabel=0 color=red]; + EQ23 -> Phi_arg13[taillabel=1]; + EQ23 -> Con_24[taillabel=2]; + If25 -> If16:p0[taillabel=0 color=red]; + If25 -> EQ23[taillabel=1]; + Phi_230 -> Loop11 [style=dotted taillabel=0]; + Phi_230 -> Store10[taillabel=1 color=blue]; + Phi_230 -> Phi_233[taillabel=2 color=blue constraint=false]; + Store31 -> If25:p0[taillabel=0 color=red]; + Store31 -> Phi_230[taillabel=1 color=blue]; + Store31 -> new9[taillabel=2]; + Store31 -> Div21[taillabel=3]; + Region32 -> If25:p0[taillabel=1 color=red]; + Region32 -> If25:p1[taillabel=2 color=red]; + Phi_233 -> Region32 [style=dotted taillabel=0]; + Phi_233 -> Store31[taillabel=1 color=blue]; + Phi_233 -> Phi_230[taillabel=2 color=blue constraint=false]; + Sub35 -> Region32[taillabel=0 color=red]; + Sub35 -> Phi_arg13[taillabel=1]; + Sub35 -> Con_36[taillabel=2]; + Return37 -> If16:p1[taillabel=0 color=red]; + Return37 -> new9[taillabel=2]; + Return37 -> MemMerge[taillabel=1 color=blue]; + MemMerge -> Start2:p1[taillabel=1 color=blue]; + MemMerge -> Phi_230[taillabel=2 color=blue]; + MemMerge -> If16:p1[taillabel=0 color=green]; +} diff --git a/chapter13/docs/graph6.json b/chapter13/docs/graph6.json new file mode 100644 index 00000000..c63c717f --- /dev/null +++ b/chapter13/docs/graph6.json @@ -0,0 +1,25 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph6.svg", + "step": 1, + "roots": [37], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}, {"idx": 1, "def": 230, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 230, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 233, "role": "MEM", "label": null}], "proj": null}, + {"id": 233, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter13/docs/graph6.svg b/chapter13/docs/graph6.svg new file mode 100644 index 00000000..d6dec88f --- /dev/null +++ b/chapter13/docs/graph6.svg @@ -0,0 +1,124 @@ +#1[1] → #6 · MEM#1[2] → #230 · MEM#10[1] → #6 · MEM#10[2] → #9 · DATA#10[3] → #4 · DATA#21[1] → #7 · DATA#21[2] → #22 · DATA#31[0] → #15 · CTRL#31[1] → #230 · MEM#31[2] → #9 · DATA#31[3] → #21 · DATA#37[1] → #1 · MEM#37[2] → #9 · DATA#230[1] → #10 · MEM#230[2] → #233 · MEM#233[1] → #31 · MEM#233[2] → #230 · MEMMemMerge  #1#1 MemMerge +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #230 MEM012Start  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +$mem  #6/1#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEMarg  #7/2#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATAnew S  #9#9 new S +Type not computed + +[0] → — CTRL0.f =  #10#10 .f = +Type not computed + +[0] → — CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #4 DATA0123True  #15/0#15 True +Projection 0 of #0 +Type not computed + +//  #21#21 // +Type not computed + +[0] → — CTRL +[1] → #7 DATA +[2] → #22 DATA012#3  #22#22 #3 +Type not computed + +.f =  #31#31 .f = +Type not computed + +[0] → #15 CTRL +[1] → #230 MEM +[2] → #9 DATA +[3] → #21 DATA0123Return  #37#37 Return +Type not computed + +[0] → — CTRL +[1] → #1 MEM +[2] → #9 DATA012MemPhi_2  #230#230 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #10 MEM +[2] → #233 MEM012MemPhi_2  #233#233 MemPhi_2 +Type not computed + +[0] → — ASSOC +[1] → #31 MEM +[2] → #230 MEM012 diff --git a/chapter13/docs/graph7.gv b/chapter13/docs/graph7.gv new file mode 100644 index 00000000..b6507e53 --- /dev/null +++ b/chapter13/docs/graph7.gv @@ -0,0 +1,23 @@ +digraph chapter13 { + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl
+
> + ]; + Con_4 [ label="#0" ]; + Loop8 [ shape=box style=filled fillcolor=yellow label="Loop" ]; + { rank=same; Loop8;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Loop8 -> Start2:p0[taillabel=1 color=red]; + Loop8 -> Loop8[taillabel=2 color=red constraint=false]; +} diff --git a/chapter13/docs/graph7.json b/chapter13/docs/graph7.json new file mode 100644 index 00000000..0e3efb9f --- /dev/null +++ b/chapter13/docs/graph7.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph7.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 8, "role": "CTRL", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [8]} + ] +} diff --git a/chapter13/docs/graph7.svg b/chapter13/docs/graph7.svg new file mode 100644 index 00000000..15d886dc --- /dev/null +++ b/chapter13/docs/graph7.svg @@ -0,0 +1,78 @@ +#8[1] → #1 · CTRL#8[2] → #8 · CTRL$ctrl  #1/0#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRLStart  #2#2 Start +Type not computed + +#0  #4#4 #0 +Type not computed + +Loop  #8#8 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #8 CTRL012Loop  #8Loop · 1 nodes−Fold region diff --git a/chapter13/docs/graph8.gv b/chapter13/docs/graph8.gv new file mode 100644 index 00000000..442b6843 --- /dev/null +++ b/chapter13/docs/graph8.gv @@ -0,0 +1,45 @@ +digraph chapter13 { +/* +while (1) {} +return 0; + +*/ + rankdir=BT; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Never18 [ shape=plaintext label=< + + + +
Never
+ + +
TrueFalse
+
> + ]; + Start2 [ shape=plaintext label=< + + + +
Start
+ + +
$ctrl
+
> + ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + Con_4 [ label="#0" ]; + Return21 [ shape=box style=filled fillcolor=yellow label="Return" ]; + Loop8 [ shape=box style=filled fillcolor=yellow label="Loop" ]; + { rank=same; Loop8;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Never18 -> Loop8[taillabel=0 color=red]; + Never18 -> Con_4[taillabel=1]; + Stop3 -> Return21[taillabel=0 color=red]; + Return21 -> Never18:p0[taillabel=0 color=red]; + Return21 -> Con_4[taillabel=2]; + Loop8 -> Start2:p0[taillabel=1 color=red]; + Loop8 -> Never18:p1[taillabel=2 color=red constraint=false]; +} diff --git a/chapter13/docs/graph8.json b/chapter13/docs/graph8.json new file mode 100644 index 00000000..b7d4f41c --- /dev/null +++ b/chapter13/docs/graph8.json @@ -0,0 +1,21 @@ +{ + "ver": 1, + "comp": "chapter13/docs/graph8.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}], "proj": {"par": 18, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}], "proj": {"par": 18, "idx": 1}}, + {"id": 6, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 8, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 18, "label": "Never", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 0, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [1, 5, 8, 18]} + ] +} diff --git a/chapter13/docs/graph8.svg b/chapter13/docs/graph8.svg new file mode 100644 index 00000000..d96a9a7d --- /dev/null +++ b/chapter13/docs/graph8.svg @@ -0,0 +1,98 @@ +#3[0] → #21 · CTRL#8[1] → #6 · CTRL#8[2] → #5 · CTRL#18[0] → #8 · CTRL#18[1] → #4 · DATA#21[0] → #1 · CTRL#21[2] → #4 · DATATrue  #1/0#1 True +Projection 0 of #18 +Type not computed + +[0] → #18 CTRLStart  #2#2 Start +Type not computed + +Stop  #3#3 Stop +Type not computed + +[0] → #21 CTRL0#0  #4#4 #0 +Type not computed + +False  #5/1#5 False +Projection 1 of #18 +Type not computed + +[0] → #18 CTRL$ctrl  #6/0#6 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRLLoop  #8#8 Loop +Type not computed + +[0] → — DATA +[1] → #6 CTRL +[2] → #5 CTRL012Never  #18#18 Never +Type not computed + +[0] → #8 CTRL +[1] → #4 DATA01Return  #21#21 Return +Type not computed + +[0] → #1 CTRL +[1] → — DATA +[2] → #4 DATA012Loop  #8Loop · 4 nodes−Fold region -- cgit v1.2.3