From 1e2ebb397cbbca1a7d2fd35052c3b90a47bb5733 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 2 Oct 2026 14:27:49 -0700 Subject: README updates thru ch10a --- chapter04/appendix/dce.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'chapter04/appendix/dce.md') diff --git a/chapter04/appendix/dce.md b/chapter04/appendix/dce.md index ad5be2d0..1f9dfa7a 100644 --- a/chapter04/appendix/dce.md +++ b/chapter04/appendix/dce.md @@ -4,12 +4,13 @@ Dead Code Elimination is the process or removing nodes that are dead(unused). There are two kinds of dead code eliminations present in this chapter. - Delete unused nodes when popping the scope. -- Delete old nodes after finding a better replacement(after idealize call). +- Delete old nodes after finding a better replacement (after calling `idealize()`). -Both of the methods mentioned above delete the nodes recursively. However, the first case happens -regardless of whether `peephole` is called or not. +Both of the methods mentioned above delete the nodes recursively. However, the +first case happens regardless of whether `peephole` is called or not. ### Delete unused nodes when popping the scope + A node is unused if it has no outputs(users). ### Example 1: @@ -109,11 +110,10 @@ return 1; - We move onto`a = 12`, since "a" has only one user left(the scope) and `this = scope` it can get killed easily. - Same as before, we go through the inputs of "a" and will delete them from the outputs of the control node. -*A constant node pointing to "Start"(ignored by the graph visualizer) but still maintains a connection:* - ![Graph3](../docs/04-dce2.svg) ## Delete old nodes after finding a better replacement + Consider the following code: ``` return (2+1)+3; -- cgit v1.2.3