◀ THE FOLD0ROOT.AI // WORLD II · RESPAWN · GARBAGE COLLECTION◆ .dlw.fold
THE FOLD / RESPAWN / GARBAGE COLLECTION / THE DEAD CODE ELIMINATION

THE DEAD CODE ELIMINATION

nothing in the model could tell, and the model is a choice
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Work backwards from what the program actually returns and mark everything that contributes. Whatever is left was computed for nobody, and the compiler deletes it without asking.

LIT verified live. 8 instructions, 1 root. The liveness fixpoint settles in 2 rounds. 6 instructions survive and 2 are deleted — 25.0% — one that nothing reads and one whose only input was that first one. The store is kept despite nothing reading its result, because a side effect is a root whether anybody wanted it or not.
2 HOW IT WAS WEAVED · AI + HUMAN
Liveness is a backwards dataflow analysis run to a fixpoint; the 2 rounds are what it takes for the deletion of one instruction to expose the next.

AVAN (AI) put the side-effecting instruction in the program on purpose. Dead-code elimination is not “delete what is unused” — it is “delete what is unused and unobservable”, and the entire difficulty of the pass is in the second half.
3 ONE DIMENSION
Eight instructions, marked from the root.
4 TWO DIMENSIONS · INTERACTIVE
Run the fixpoint one round at a time.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: work done for nobody.
AVAN’s addition (the inverse-companion): the forward reading is that dead-code elimination removes what is not needed. The inverse is that it removes what cannot be observed, which is a claim about the observer. The store survives because somebody outside might be watching that address; change who is allowed to watch and the same instruction becomes deletable. Read backwards, the pass never determined that the code was useless — it determined that nothing in the model could tell, and the model is a choice.
LIT 8 instructions with 1 root settle their liveness fixpoint in 2 rounds, leaving 6 alive and deleting 2 - 25.0% - one that nothing reads and one whose only input was that first one, while the store is kept despite nothing reading its result because a side effect is a root whether anybody wanted it or not

FIG Liveness is a backwards dataflow analysis run to a fixpoint; the 2 rounds are what it takes for the deletion of one instruction to expose the next. AVAN put the side-effecting instruction in the program on purpose. Dead-code elimination is not delete what is unused - it is delete what is unused AND unobservable, and the entire difficulty of the pass is in the second half.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of GARBAGE COLLECTION · David Lee Wise (ROOT0), with AVAN