summaryrefslogtreecommitdiff
path: root/chapter24
Commit message (Collapse)AuthorAgeFilesLines
* Slides for 2026 REBASEreadmeCliff Click11 days1-3/+4
|
* Chapter renumber, and split ch 17Cliff Click12 days44-939/+1083
| | | | | | Renumber chapters 10a, 10b, 11, 12, 13, 14 -> 10, 11, 13, 12, [11,14]. Split ch 17 into a 17a and 17b; shuffle around im/mutable syntax to be consistent, and present it more slowly. THe new immutable syntax is pushed through all later chapters
* First pass README updatesCliff Click13 days1-15/+18
|
* Fix bug loop tree depth on inf loopsCliff Click13 days9-13/+125
|
* Restore missing anti-dependence walkCliff Click14 days2-10/+33
|
* Move much of the ISA support to shared codeCliff Click14 days138-2493/+425
| | | | The ISA shared handlers here are required for a proper compiler, but contain only trivial bit-massaging operations.
* Move debug printing into shared spaceCliff Click14 days54-967/+361
| | | | Same as the graph viewer, moves a lot of code out of all Nodes
* Merge pull request #258: same constant phi merge testCliff Click2026-09-301-0/+15
|\ | | | | | | Preserve the regression across the Chapter 10 split by including it in both chapter10a and chapter10b. Validated Chapter05Test in all 22 affected snapshots (374 tests).
| * Add same constant phi merge testfuhsnn2026-09-291-0/+15
| |
* | Finish forward-port mem ops thru ch25Cliff Click2026-09-3034-559/+1315
| |
* | Forward port mem stuff to ch21Cliff Click2026-09-308-16/+60
|/ | | | Also a minor reg-alloc improvement for BrainFuck, ported up to ch25
* Extend smaller-width C results to full widthCliff Click2026-09-2811-13/+242
|
* Backport FunPtrCliff Click2026-09-2816-27/+150
| | | | | Helps keep functions alive via ptr only (no calls). A few RISC 5 TFP encoding fixes.
* Support extern C ver direct updatesCliff Click2026-09-283-4/+36
| | | | FIx minor RISC encodings.
* Check un-init not-null constructor fieldsCliff Click2026-09-285-12/+14
| | | | | | | | Propagate BOT inputs; Arith, Load. CallEnd inlining, the FUnPtr dies early. Load asserts when loading against uninit not-null field. Keep not-nill state for storage class. Clean up Node.peep as constant.
* Remove -disablePeepholeCliff Click2026-09-278-92/+6
|
* bug fix widenCliff Click2026-09-267-69/+84
| | | | Failed lattice law tests mixing constants and have wide type ints; or mixing wide ints and constant arrays.
* Extend and backport SubNode peephole (#254)Hsiang-Ying Fu2026-09-254-4/+59
| | | | | | | | | | | | | | | * Extend and backport SubNode peephole * Add tests * Restrict subtraction zero peepholes to integer operands Require resolved integer mode in chapter 25 so zero subtraction preserves floating-point signed zero. Keep nonnumeric operands in the graph for subtraction diagnostics. Add signed-zero coverage from chapter 12 and null-subtraction diagnostics from chapter 22. Confirmed the regressions fail on the original PR. Full Make suites pass in chapters 4-25 (5462 tests), including fresh chapter 25 sys.o compilation. --------- Co-authored-by: Cliff Click <cliffc@acm.org>
* Merge branch 'main' of https://github.com/SeaOfNodes/SimpleCliff Click2026-09-252-2/+2
|\
| * Update test result for sysV (#253)Hsiang-Ying Fu2026-09-252-2/+2
| |
* | Bunch more animation workCliff Click2026-09-255-3/+20
|/
* Bunch better layout optionsCliff Click2026-09-241-1/+3
|
* Keyboard shortcutsCliff Click2026-09-234-4/+20
| | | | | Fast forward/reverse, pick-a-frame. Shorter type names.
* Graph cleanupCliff Click2026-09-222-1/+3
| | | | Phis stay with regions, stop sinks to bottom,
* Tidy up scope displayCliff Click2026-09-221-1/+1
|
* Add shared graph viewer to all chaptersCliff Click2026-09-2234-1038/+162
|
* move the graph visualizer into shared codeCliff Click2026-09-217-2270/+90
|
* Final reg-alloc across chapters cleanupCliff Click2026-09-209-25/+84
|
* Split self-conflict phis once at a loop headCliff Click2026-09-2028-177/+842
| | | | if this works, saves a copy-per-loop. If it fails, next round split as normal
* Popular use grouping for RegAllocCliff Click2026-09-208-67/+209
| | | | Fix arm BL encodings; ADD/SUB with reversed sign.
* Forward-port allocator bug fixes and test support through ch25Cliff Click2026-09-2015-64/+351
| | | | Improved spilling
* Add back copy coaleascing in ch21Cliff Click2026-09-203-3/+34
| | | | Minor arm encoding fix.
* Backport TypeFunPtr normalizationCliff Click2026-09-201-1/+18
|
* Unify GCM across chaptersCliff Click2026-09-207-111/+127
| | | | | | Remove the _anti field. Remove the isPinned() call. Add a copyEmpty call.
* Unify mixed-return checking and resultsCliff Click2026-09-1914-49/+90
| | | | Unify dominator caching.
* Use isDead() instead of checking null inputsCliff Click2026-09-191-1/+1
|
* Fixed st8 on arm/risc evalsCliff Click2026-09-193-2/+30
|
* debug printers no longer call self-optimizing accessorsCliff Click2026-09-1920-21/+250
|
* Tighter recursive-struct testCliff Click2026-09-192-1/+22
|
* Handle double-negation preserving not-null knowledgeCliff Click2026-09-193-3/+121
|
* Backport string escapes and many op-assignCliff Click2026-09-173-11/+212
|
* Parser fix OR tempsCliff Click2026-09-172-1/+43
|
* Backport x86 Not encodingCliff Click2026-09-172-10/+51
|
* x86 mul reg reg encoding fixCliff Click2026-09-174-35/+81
|
* Back point cmpmem encodingCliff Click2026-09-172-1/+34
|
* Get makefiles and fuzzer testing uniform across chaptersCliff Click2026-09-174-15/+50
|
* Fix stale copy-pasted comment on BoolNode's phiCon call (#249)Symious2026-09-091-3/+3
| | | | | | | | | | | | | | | | | | The three comment lines above `AddNode.phiCon(this, ...)` in BoolNode were copy-pasted from MulNode and never adapted: they use `*` as the operator and describe the rotated shape `(x * (phi cons)) * con`. For BoolNode neither is right. The operator is a compare, and in chapters 6-9 `rotate` is hard-coded `false`, so the rotated shape is never matched; the shapes actually handled are `(phi cons) cmp con` and `(phi cons) cmp (phi cons)`. Reword the comment accordingly, and in chapters 6-9 add a line noting why rotate is off. Chapters 10-25 pass `this instanceof EQ`, so no such claim is made there. Comment-only change; no code is touched. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* Chapter 25: add separate compilation and simplify SSA constructionCliff Click2026-08-101-391/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce Chapter 25 with separately compiled Simple modules, serialized IR, cross-compilation-unit linking, and native system-library integration. This also completes a broad parser and type-system cleanup needed to make graph construction independent of incomplete parse-time type information. Separate compilation and linking - Add compilation-unit Start/Stop nodes and track functions, classes, aliases, and global indices across compilation-unit boundaries. - Serialize canonical types and ideal graph nodes into ELF objects, including dependency metadata, relocations, global/local bitset remapping, and dense memory-alias information. - Load dependent objects on demand, recursively resolve source and object paths, relink calls and function pointers, and preserve external C symbols. - Distinguish the post-optimization ownership hook from unknown callers so private call graphs can remain precise while public functions remain externally callable. - Add command-line and build support for compiling modules and the reusable `sys` object library. Parser, constructors, and SSA - Replace inline constructor expansion with a hidden default `<init>` followed by an explicit user constructor declared as `new Type = { ... }`. - Keep the default constructor private, pass private object memory through constructor calls, and require user constructors to initialize non-default fields before the object escapes. - Track possibly-uninitialized fields in parser `Var` state and diagnose early reads without encoding parser-only constraints in Load and Store nodes. - Make ordinary parser memory bulk and recover precise alias slices in the optimizer using `MemMerge`, `MemPhi`, and `BulkMemPhi` nodes. - Remove parser-supplied type constraints from Loads and ordinary Phis, defer integer/float arithmetic selection, and keep call shape driven by syntax instead of provisional inferred types. - Preserve chained field declarations as static parser information when flow types are not yet available, including postfix field updates through calls. Types, functions, and escape analysis - Add `TypeScalar` as the common lattice family for integer, float, memory pointer, and function-pointer values, with scalar TOP/BOT values for generic Loads, Stores, parameters, and invalid intermediate expressions. - Represent unresolved struct definitions directly with the `TypeStruct` forward-reference flag while retaining the separate open-structure concept; close and canonicalize recursive structures without side maps. - Add explicit `FunPtrNode` references so constant function pointers retain a graph edge to their Return, and keep referenced functions alive until Opto proves the pointer dead. - Refine public-function and class-initializer escape handling, including public-only fallback escape sets and monotone compilation-unit summaries. - Add guards, proof casts, read-only propagation, pointer-to-integer conversion for non-null FFI arguments, and consistent deep mutability checks at calls. Optimization and code generation - Make weak and unresolved graph inputs compute conservatively and monotonically throughout iterative peepholes and SCCP. - Preserve independent memory slices when sharpening Stores, retain control on conditional Stores, and freeze Store widths from their target field types. - Extend serialization for new node kinds, scalar types, Store modes, function pointers, and memory partitions, preserving serialize/deserialize bijection. - Complete native selection and encoding support across x86-64, RISC-V, and ARM, including FFI pointer conversion and missing integer operations. - Fix x86 immediate multiply REX encoding and assorted scheduling, register allocation, spilling, relocation, and constant-pool issues exposed by the larger linked graphs. System library, tests, and documentation - Compile and link the Simple `sys` library, including libc bindings, I/O, scanners, strings, vectors, array helpers, and executable entry points. - Add Chapter 25 module, serialization, constructor, forward-reference, postfix-update, system, Hello World, and Bubble Sort coverage; update golden graphs and spill expectations for the new IR shape. - Add module and type-system documentation, parser-simplification design notes, grammar updates, examples, diagrams, and graph visualization assets. The resulting compiler passes the raw Chapter 1-24 suite and the Chapter 25 system and separate-compilation tests, including a freshly rebuilt `sys.o` and the native Bubble Sort example.
* Move `addUse()` return statement to `keep()` (#243)Hsiang-Ying Fu2026-07-031-7/+4
|
* Series of minor fixesCliff Click2026-07-034-25/+25
|