kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

commit 5bb76983d44810cd47de7b80b17347162ecd5e10
parent 14bd1c60e822fe089b54af53117d9f501ec91f03
Author: Ryan Sepassi <rsepassi@gmail.com>
Date:   Tue, 16 Jun 2026 10:18:45 -0700

doc/plan/O1-PATTERNS.md: §2 L1–L10 landed (1.09x → 1.059x clang) + volatile-load fix

Diffstat:
Mdoc/plan/O1-PATTERNS.md | 19+++++++++++++++++++
1 file changed, 19 insertions(+), 0 deletions(-)

diff --git a/doc/plan/O1-PATTERNS.md b/doc/plan/O1-PATTERNS.md @@ -7,6 +7,25 @@ is the successor to that worklist: it identifies what remains, ranks the linear/no-SSA wins still on the table, and cleanly separates them from the gaps that genuinely require the parked O2 SSA mid-end. +> **Update (2026-06-16): all of §2 (L1–L10) is landed.** Implemented in parallel +> (worktree-isolated agents) and merged gated. Aggregate `__TEXT` **1.09× → +> 1.059× clang** (lvm 2.86× → **2.57×** via L1; yyjson 0.86× → **0.80×** via +> L6/L4/L2; sqlite 1.11× → **1.09×**; lparser 1.07× → **1.04×** via L9; tinyexpr +> via L10). Per-item: **L1** store→load forwarding (`pass_combine.c`, lvm −9.95%), +> **L2** cset→cmp_branch fusion (same-block subset; cross-block stays O2), **L3** +> widen `aa_set_bytes` zero-init (`aa64/native.c`, cjson −5.4%), **L4** double-cset +> drop, **L5** confirmed already-subsumed by `try_substitute`/`try_ret_retarget` +> (no unsound new fold; the scratch-source residual is a miscompile, left out), +> **L6** sxt-after-load drop (yyjson −5.45%), **L7** shift-into-ALU + **L8** +> sxtw-index-into-addressing (Operand riders, aa64-only; x64/rv64 capability-gated +> off), **L9** const div/mul fold (`pass_simplify.c`, lparser udiv 22→0), **L10** +> frameless-leaf elision. L9 also surfaced + got fixed a **latent volatile-load +> miscompile** (a volatile load of a register-resident local was served from the +> value-residency fast path with no observable memory access emitted; fixed in +> `src/cg/memory.c`). Gates: test-opt (18 guards) + test-toy 1392/0 + ecosystem +> 28/0 + smoke-x64/rv64 3/0 + test-cg-api 289/289. The §3 (SSA/O2) and §4 +> (not-a-deficiency) findings below stand. + Read [O1.md](O1.md) first — especially §3 (the landed worklist), §4 (the SSA/O2 out-of-scope list), and §5 (already-landed). Read [OPT.md](OPT.md) §3 for the O1 pipeline and pass inventory. Every "linear" claim here is checked against those.