summaryrefslogtreecommitdiff
path: root/chapter04
diff options
context:
space:
mode:
authorTamas Hadhazy <helsgithub15@gmail.com>2024-10-05 14:48:34 +0100
committerCliff Click <cliffc@acm.org>2024-10-06 09:20:04 -0700
commit17439b589db2851e7315042c0359df3bff436fdb (patch)
treeefff31915cd9c9761824d2bd1045ef2b3a9184f5 /chapter04
parenta728e57ad819dad9281d690f22cebb8e2b3ca003 (diff)
downloadSimple-17439b589db2851e7315042c0359df3bff436fdb.tar.gz
Simple-17439b589db2851e7315042c0359df3bff436fdb.zip
fix typos, better graph position
Diffstat (limited to 'chapter04')
-rw-r--r--chapter04/README.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/chapter04/README.md b/chapter04/README.md
index e96457c8..8d09320c 100644
--- a/chapter04/README.md
+++ b/chapter04/README.md
@@ -418,7 +418,7 @@ void popN(int n) {
First, we start off by looping through the inputs of the scope(*remember*: scope is just a node like any other, the symbols of the scope are the inputs).
If the node returned by `removeLast` is not null, and if the only user of `old_def` is the current Node then we can delete it.
-`old_def.delUse(this)` - delete *this* from 'old_def's output.
+`old_def.delUse(this)` - delete *this* from `old_def`'s outputs.
```java
protected boolean delUse( Node use ) {
Utils.del(_outputs, Utils.find(_outputs, use));
@@ -443,7 +443,7 @@ drop the `Start` node from the inputs of `ConstantNode`:
```
Node old_def = _inputs.removeLast();
```
-we also get rid of `ConstantNode`(`this`) from the outputs of `Start`:
+we can also get rid of `ConstantNode`(`this`) from the outputs of `Start`:
```
old_def.delUse(this)
```
@@ -459,6 +459,7 @@ return (2+1)+3;
```
Without DCE after the `idealize` call we would end up with:
![Graph3](docs/04-dce3.svg)
+
After identifying a more optimal replacement value (6) for the expression (2 + 1) + 3,
we created a constant node to store this value.
However, we did not remove the original expression,