feat(jit): SSA optimization pipeline with CSE/Load CSE - REVIEW NEEDED - #102
Open
bardo84 wants to merge 1 commit into
Open
feat(jit): SSA optimization pipeline with CSE/Load CSE - REVIEW NEEDED#102bardo84 wants to merge 1 commit into
bardo84 wants to merge 1 commit into
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019b4609-def5-7157-9c1c-0603819bc7d7 Co-authored-by: Amp <amp@ampcode.com>
|
@bardo84 is attempting to deploy a commit to the Dystr Team on Vercel. A member of the Team first needs to authorize it. |
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.
Summary
Adds SSA-based optimization passes to the Turbine JIT compiler, achieving 7.3x speedup on loop-heavy benchmarks.
This is an experimental implementation that requires review by founding authors before production use. Key areas needing attention:
ssa.rs,ssa_builder.rs)ssa_opt.rs)sizelevel regression (slower thannone)Suggested Review Order
SSA_IR_DEEP_DIVE.md(architecture overview)ssa.rs(data structures, 500 lines)ssa_opt.rs- focus on:optimize()function (lines 23-52)cse()(lines 347-395)load_cse()(lines 404-450)lib.rschanges (146 lines modified)dominators.rs,loop_analysis.rs(standard algorithms)Benchmark Results (4B iterations, median of 7 runs)
CLI Optimization Levels
--jit-opt-levelnonesizespeedaggressiveIndividual Pass Analysis (via
RUNMAT_SSA_PASSES)0123size121415Key Insight
CSE + Load CSE are the critical optimizations. The combination of all passes (simplify → DCE → CSE → Load CSE → DCE) produces the best results due to pass synergy.
New Optimizations
Testing