perf(compiler): reduce repeated cold-path scans - #577
Open
abmcar wants to merge 4 commits into
Open
Conversation
⚡ 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: 194 benchmarks, 0 regressions |
Replace the EVM MIR builder linear membership scan with MFunction indexed pointer identity lookup. Add focused tests for membership and entry block reuse.
Short-circuit dead-instruction use checks by walking the use suffix backward instead of traversing the full def-use chain. Preserve self-use semantics and cover the tail instruction explicitly.
abmcar
force-pushed
the
agent/reduce-compiler-cold-path-scans
branch
from
July 27, 2026 08:15
9d8e287 to
56729ee
Compare
abmcar
marked this pull request as ready for review
July 27, 2026 08:32
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 (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
This PR removes two repeated linear scans observed in cold multipass compilation:
EVMMirBuilder::setInsertBlocknow checks membership through the block'sstable
MFunctionindex and pointer identity instead of scanning everyblock in the function.
scans only the use suffix, avoiding repeated traversal of the definition
prefix while preserving self-use behavior.
The MIR lookup relies on the existing live-block, append-only/stable-index
contract. The CGIR lookup relies on the existing definition-prefix/use-suffix
operand-chain layout. Focused tests cover unappended MIR blocks with default
indices, pointer-identity membership after append, entry-block reuse,
preservation of external uses, deletion of self-uses, multiple definitions,
and fixed-point deletion after an external use is removed.
The branch is rebased onto upstream
mainata7e73059, which includes themerged PR #560 and PR #561 fixes.
Pre-rebase LabPerf diagnostic evidence, collected on implementation head
1edac697based on57324bd: on the frozen 4-block/499-transactionprefix004corpus, the combined candidate reduced first cold block-executiontime from 2,238.890–2,263.209 seconds to 1,083.372 seconds (51.6–52.1%,
2.07–2.09x). In cold
cycles:uprofiles,CgDeadCgInstructionElim::isDeadmoved from 39.53% to 0.28% flat sampledcycles and
EVMMirBuilder::setInsertBlockfrom 12.92% to 0.01%. This isworkload-specific diagnostic evidence, not a full-mainnet, 32-block,
production, runtime, or statistically formal benchmark claim. It motivates
the change but does not measure the rebased integration.
No public export, SONAME, dependency, object layout, global state, threading,
or determinism change was found.
Change document:
docs/changes/2026-07-24-reduce-compiler-cold-path-scans/README.md4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
Validated on implementation head
7390935rebased ontoa7e73059. Thesubsequent change-document commit
56729eedoes not modify source or tests:cmake -S . -B build && cmake --build build -j56tools/format.sh checkgit diff --check upstream/main..HEADtools/dtvm_local_test.sh --auto --base upstream/main --jobs 1:unit 223/223, EEST state 2723/2723, EVM assembly 209/209, and CTest 12/12
successfully on PR head
56729eewith 0 regressions in each mode
6. Release note