summaryrefslogtreecommitdiff
path: root/chapter19/README.md
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-09-30 08:43:15 -0700
committerCliff Click <cliffc@acm.org>2026-09-30 08:43:15 -0700
commit612555ee37f733ff3f902b2ab149b318db334aec (patch)
tree6e7d0ba666b927d3439adb3982c07e4e88a5a697 /chapter19/README.md
parent2d51b64758db57e7d549639d12af35d03a0bd3d8 (diff)
downloadSimple-612555ee37f733ff3f902b2ab149b318db334aec.tar.gz
Simple-612555ee37f733ff3f902b2ab149b318db334aec.zip
Forward port mem changes to ch 19
Diffstat (limited to 'chapter19/README.md')
-rw-r--r--chapter19/README.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/chapter19/README.md b/chapter19/README.md
index 0d8e481f..63929b34 100644
--- a/chapter19/README.md
+++ b/chapter19/README.md
@@ -53,6 +53,32 @@ global. In short the compiler gets a lot more functional, and a big step
towards concurrent or multi-threaded compilation.
+## Memory through instruction selection
+
+The parser carries one `$mem` binding. BulkMemPhi splits aliases on demand into
+parallel MemPhis, while MemMerge packages a default memory and explicit slices.
+Both machine selectors preserve these node classes and their alias information;
+they do not turn memory Phis into ordinary value Phis.
+
+This chapter lowers nonzero constructor values into explicit Stores, keeping the
+allocation itself a zeroing operation. New consumes `{ctrl, $mem, size}` and
+produces `{ptr, $mem}`. Its input is a partial MemMerge covering the allocated
+struct's aliases; its single memory result covers those same aliases. The parser
+preserves unrelated memory in the surrounding aggregate. The allocation's size
+register is input 2, its pointer result is output 0, and memory has no register.
+
+Selected memory operations retain their field alias even when an x86 arithmetic
+or comparison instruction absorbs a Load. Global scheduling therefore finds
+anti-dependencies through the common MemOpNode, following the relevant slice
+through MemMerge. Memory-result instructions are writers; other memory operations
+are readers. Trailing ordering edges on writers impose no register requirement.
+The simple one-step Load guard used when factoring Phis is unchanged.
+
+Calls still consume and produce whole memory. They terminate their blocks, so
+scheduling raises a read before a Call without adding inputs to its argument
+list. Direct machine calls embed their constant target and retain only control,
+memory, and argument inputs.
+
## Registers and Register Masks