Repository navigation
Reduce repeated CFG and optimizer work; restore driver size compliance - #172
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optimized simdjson compilation repeatedly builds control-flow and dominator facts during jump threading. Phi demotion was building an intermediate graph that its caller immediately changed again without reading. Defer that rebuild until after the caller redirects the edges, and share CFG ordering's DFS preorder and parent links with Lengauer-Tarjan instead of traversing the graph twice.
These two changes reduce total compiler instructions by another 5.19% for scalar simdjson and 3.79% for SSE, compared with the initial micro-optimization patch. Cycles fall 4.26% / 3.41%; paired local wall estimates are about 4% lower, but A/A scheduling noise prevents a precise timing claim. Frozen O3 instructions fall 0.38%. No transformation limits or ordering change, and measured output remains byte-identical. The report records call-chain attribution, controls, remaining opportunities, and the rejected alternative dominator solver.
Also retain instruction-to-block maps across operand-only propagation and dead-code removal, bound an ineligible jump-threading search, and use dominance intervals before ancestor walks. Extract Wasm stack-size parsing from driver argument dispatch, reducing
parsefrom 243 to 231 code lines with identical diagnostics.Filter front-end name lookup with per-scope name bits. Each analyzer scope and each parser scope keeps 64 bits, one per name hash, set when a name is entered in that scope. A clear bit answers a scope search without a probe of the shared name table. On 16 LLVM units, 61% of the analyzer's 15.8M scope searches are in scopes that do not declare the name, and these probes are cache misses. Against 0.9.4 over 9 paired rounds on the same units, cycles fall 4.1% syntax-only, 3.6% at -O0 and 2.8% at -O2; instructions fall 0.19–0.26%. Objects are byte-identical at -O0 and -O2.
Validation: full strict course report, debug-info tests, PA36 smoke, self-host through PA5, inception, architecture/file/placement audits and CI-pinned formatting. PA36's source-identity check compares all 467 compiler objects; scalar/SSE/frozen objects match at O0–O3. Independent vertex-removal reachability validates dominance on 1,000 random graphs with handler edges and reused storage, plus a 20,000-block chain. The earlier twelve parser probes match exit status and output. No LTO, PGO, benchmark-input or reference changes. For the name-bit commit: full strict course report, debug-info tests, self-host through PA5, architecture/file/placement audits and CI-pinned formatting.
🤖 Generated with Claude Code