perf(evm): reuse CFG memory proofs for RETURN and REVERT - #584
Merged
zoowii merged 2 commits intoJul 29, 2026
Conversation
Record RETURN and REVERT helper PCs after closing their source block so later lowering can query the exact per-op memory facts. Previously handleEndBlock cleared the current memory opcode identity before the terminating helper was lowered.
Let RETURN and REVERT reuse guaranteed memory-size facts produced by the CFG analysis when their constant output range is already covered. Previously both terminators emitted another expansion check even after a predecessor had established the same range; dynamic, uncovered, overflow-prone, and zero-size cases keep the existing fallback semantics.
⚡ Performance Regression Check Results✅ Performance Check Passed (interpreter)Performance Benchmark Results (threshold: 25%)
Summary: 194 benchmarks, 0 regressions ✅ Performance Check Passed (multipass)Performance Benchmark Results (threshold: 25%)
Summary: 193 benchmarks, 0 regressions |
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.
1. Does this PR affect any open issues?(Y/N) and add issue references:
2. What is the scope of this PR:
EVM multipass JIT memory expansion analysis and lowering:
src/action/evm_bytecode_visitor.hsrc/compiler/evm_frontend/evm_mir_compiler.{h,cpp}3. Provide a description of the PR:
Reuse CFG-derived guaranteed memory prefixes when lowering constant-range
RETURNandREVERToperations in the multipass JIT.expandMemoryIRonly when a constant non-empty range is covered bygetGuaranteedMinBytesBeforeOpOn the existing 65-contract on-chain corpus, compiled paths report 401 eliminated expansion IR sites across 30 contracts: 24 for
RETURNand 377 forREVERT.4. Are there any breaking changes?(Y/N):
5. Are there test cases for these changes?(Y/N):
Validation:
./tools/format.sh format./tools/format.sh checkevmJitFrontendTests: 111/111 passedevmDifferentialTests: 26/26 passed, including output/status/gas equivalence and zero-size high-offset cases6. Release note