summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordibyendumajumdar <mobile@majumdar.org.uk>2023-10-27 20:37:10 +0100
committerDibyendu Majumdar <dibyendumajumdar@users.noreply.github.com>2023-11-01 18:56:50 +0000
commitfac906ecc559e82215cbbb4ab50de364b535b6e9 (patch)
tree520f4ece56cf14b9c3e0494dcd9c4f976ea490cc
parente118e0947898b00b2d451da56964c5b870aeb8e8 (diff)
downloadSimple-fac906ecc559e82215cbbb4ab50de364b535b6e9.tar.gz
Simple-fac906ecc559e82215cbbb4ab50de364b535b6e9.zip
Start on Chapter 5
-rw-r--r--chapter05/README.md8
1 files changed, 5 insertions, 3 deletions
diff --git a/chapter05/README.md b/chapter05/README.md
index 12061756..61b6c8d3 100644
--- a/chapter05/README.md
+++ b/chapter05/README.md
@@ -2,7 +2,7 @@
In this chapter we extend the language grammar with following features:
-* If introduce `if` statement.
+* We introduce the `if` statement.
* To support splitting of control flow and merging, we introduce new nodes: `Region` and `Phi`.
* Since we can now have multiple return points, we also introduce the `Stop` node as the termination.
@@ -27,11 +27,13 @@ Here is a recap of the nodes introduced in previous chapters:
| UnaryMinus | Data | 2 | Negate a value | One data node, value is negated | Result of the unary minus |
| Scope | ? | 3 | Represents scopes in the graph | All nodes that define variables | None |
-New Nodes introduced in this chapter:
+## New Nodes
+
+Following new nodes are introduced in this chapter:
| Node Name | Type | Chapter | Description | Inputs | Value |
|-----------|---------|---------|----------------------------------------------------------------------|------------------------------------------------------------------------------------------------|---------------------------------------------------------------|
-| If | Control | 5 | Represents an `if` condition | A control node and a data predicate node | A tuple of two values, one for true branch, another for false |
+| If | Control | 5 | Represents an `if` condition, sub type of `MultiNode` | A control node and a data predicate node | A tuple of two values, one for true branch, another for false |
| Region | Control | 5 | Represents a merge point from multiple control flow | An input for each control flow that is merging | None |
| Phi | ? | 5 | Represents the phi function that picks a value based on control flow | A region control node, and multiple data nodes that provide values from multiple control flows | Result is the extracted value depending on control flow taken |
| Stop | Control | 5 | Represents termination of the program | One or more Return nodes | None |