Skip to content

Commit 79b3788

Browse files
camelidJoshua Nelson
authored andcommitted
Explain the purpose of the bottom value
1 parent 9e346c9 commit 79b3788

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/mir/dataflow.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ statement must be considered separately from the left-hand side.
9292
Your analysis must converge to "fixpoint", otherwise it will run forever.
9393
Converging to fixpoint is just another way of saying "reaching equilibrium".
9494
In order to reach equilibrium, your analysis must obey some laws. One of the
95-
laws it must obey is that the bottom value joined with some other value equals
96-
the second value. Or, as an equation:
95+
laws it must obey is that the bottom value[^bottom-purpose] joined with some
96+
other value equals the second value. Or, as an equation:
9797

9898
> *bottom* join *x* = *x*
9999
@@ -105,6 +105,10 @@ Having a top value ensures that your semilattice has a finite height, and the
105105
law state above ensures that once the dataflow state reaches top, it will no
106106
longer change (the fixpoint will be top).
107107

108+
[^bottom-purpose]: The bottom value's primary purpose is as the initial dataflow
109+
state. Each basic block's entry state is initialized to bottom before the
110+
analysis starts.
111+
108112
## Inspecting the Results of a Dataflow Analysis
109113

110114
Once you have constructed an analysis, you must pass it to an [`Engine`], which

0 commit comments

Comments
 (0)