Skip to content

feat(compiler): add EVM memory compile instrumentation summary#414

Merged
zoowii merged 5 commits intoDTVMStack:mainfrom
ECNUyhy:memory-path
Mar 26, 2026
Merged

feat(compiler): add EVM memory compile instrumentation summary#414
zoowii merged 5 commits intoDTVMStack:mainfrom
ECNUyhy:memory-path

Conversation

@ECNUyhy
Copy link
Copy Markdown
Contributor

@ECNUyhy ECNUyhy commented Mar 17, 2026

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

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):

  • Affects user behaviors
  • Contains CI/CD configuration changes
  • Contains documentation changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

6. Release note

None

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

⚡ Performance Regression Check Results

✅ Performance Check Passed (interpreter)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.50 1.49 -0.5% PASS
total/main/blake2b_huff/empty 0.02 0.02 -1.2% PASS
total/main/blake2b_shifts/8415nulls 11.75 11.72 -0.2% PASS
total/main/sha1_divs/5311 5.07 5.11 +0.7% PASS
total/main/sha1_divs/empty 0.06 0.06 +1.2% PASS
total/main/sha1_shifts/5311 2.78 2.90 +4.4% PASS
total/main/sha1_shifts/empty 0.03 0.04 +2.7% PASS
total/main/snailtracer/benchmark 53.17 52.93 -0.5% PASS
total/main/structarray_alloc/nfts_rank 1.04 1.04 +0.1% PASS
total/main/swap_math/insufficient_liquidity 0.00 0.00 -0.0% PASS
total/main/swap_math/received 0.00 0.01 +0.2% PASS
total/main/swap_math/spent 0.00 0.00 -0.4% PASS
total/main/weierstrudel/1 0.29 0.29 +0.2% PASS
total/main/weierstrudel/15 3.16 3.16 +0.0% PASS
total/micro/JUMPDEST_n0/empty 2.12 1.63 -23.0% PASS
total/micro/jump_around/empty 0.10 0.10 +0.0% PASS
total/micro/loop_with_many_jumpdests/empty 31.74 25.00 -21.3% PASS
total/micro/memory_grow_mload/by1 0.09 0.09 +0.6% PASS
total/micro/memory_grow_mload/by16 0.10 0.10 +0.1% PASS
total/micro/memory_grow_mload/by32 0.11 0.11 -1.2% PASS
total/micro/memory_grow_mload/nogrow 0.08 0.09 +0.8% PASS
total/micro/memory_grow_mstore/by1 0.09 0.10 +3.9% PASS
total/micro/memory_grow_mstore/by16 0.11 0.11 -0.4% PASS
total/micro/memory_grow_mstore/by32 0.12 0.12 -0.4% PASS
total/micro/memory_grow_mstore/nogrow 0.09 0.09 +5.9% PASS
total/micro/signextend/one 0.24 0.24 -0.1% PASS
total/micro/signextend/zero 0.24 0.24 +0.1% PASS
total/synth/ADD/b0 3.51 3.51 -0.0% PASS
total/synth/ADD/b1 2.01 2.00 -0.1% PASS
total/synth/ADDRESS/a0 4.83 4.82 -0.0% PASS
total/synth/ADDRESS/a1 5.27 5.30 +0.4% PASS
total/synth/AND/b0 1.64 1.64 -0.1% PASS
total/synth/AND/b1 1.70 1.69 -0.3% PASS
total/synth/BYTE/b0 6.04 6.04 +0.0% PASS
total/synth/BYTE/b1 4.74 4.76 +0.3% PASS
total/synth/CALLDATASIZE/a0 3.21 3.19 -0.3% PASS
total/synth/CALLDATASIZE/a1 4.05 4.06 +0.3% PASS
total/synth/CALLER/a0 4.84 4.83 -0.2% PASS
total/synth/CALLER/a1 5.37 5.39 +0.3% PASS
total/synth/CALLVALUE/a0 3.02 3.04 +0.7% PASS
total/synth/CALLVALUE/a1 3.36 3.38 +0.5% PASS
total/synth/CODESIZE/a0 3.43 3.43 -0.0% PASS
total/synth/CODESIZE/a1 3.77 3.79 +0.5% PASS
total/synth/DUP1/d0 1.07 1.06 -0.2% PASS
total/synth/DUP1/d1 1.23 1.23 -0.1% PASS
total/synth/DUP10/d0 1.07 1.07 -0.1% PASS
total/synth/DUP10/d1 1.16 1.16 -0.3% PASS
total/synth/DUP11/d0 0.83 1.07 +29.1% PASS
total/synth/DUP11/d1 0.93 0.92 -0.3% PASS
total/synth/DUP12/d0 1.09 1.07 -2.1% PASS
total/synth/DUP12/d1 1.16 0.92 -20.5% PASS
total/synth/DUP13/d0 1.07 1.07 -0.0% PASS
total/synth/DUP13/d1 1.16 0.92 -20.4% PASS
total/synth/DUP14/d0 1.07 1.07 -0.2% PASS
total/synth/DUP14/d1 0.98 0.92 -5.6% PASS
total/synth/DUP15/d0 1.07 1.07 -0.1% PASS
total/synth/DUP15/d1 0.93 0.94 +0.7% PASS
total/synth/DUP16/d0 1.07 1.07 +0.4% PASS
total/synth/DUP16/d1 0.93 1.16 +24.9% PASS
total/synth/DUP2/d0 0.82 1.07 +29.7% PASS
total/synth/DUP2/d1 1.16 0.93 -19.8% PASS
total/synth/DUP3/d0 1.07 1.07 +0.0% PASS
total/synth/DUP3/d1 0.92 1.15 +25.3% PASS
total/synth/DUP4/d0 1.07 1.07 +0.2% PASS
total/synth/DUP4/d1 1.16 1.16 -0.3% PASS
total/synth/DUP5/d0 1.07 1.07 +0.0% PASS
total/synth/DUP5/d1 1.16 1.16 -0.2% PASS
total/synth/DUP6/d0 1.05 1.07 +1.4% PASS
total/synth/DUP6/d1 1.16 1.16 -0.1% PASS
total/synth/DUP7/d0 1.07 1.07 -0.0% PASS
total/synth/DUP7/d1 1.16 0.92 -20.7% PASS
total/synth/DUP8/d0 0.83 1.07 +29.1% PASS
total/synth/DUP8/d1 1.16 0.94 -19.2% PASS
total/synth/DUP9/d0 0.83 1.07 +28.9% PASS
total/synth/DUP9/d1 1.16 0.92 -20.5% PASS
total/synth/EQ/b0 2.72 2.72 +0.0% PASS
total/synth/EQ/b1 1.40 1.40 -0.4% PASS
total/synth/GAS/a0 3.67 3.67 -0.0% PASS
total/synth/GAS/a1 3.69 3.70 +0.4% PASS
total/synth/GT/b0 2.61 2.61 +0.0% PASS
total/synth/GT/b1 1.40 1.39 -0.4% PASS
total/synth/ISZERO/u0 0.99 0.99 -0.0% PASS
total/synth/JUMPDEST/n0 2.12 1.63 -22.9% PASS
total/synth/LT/b0 2.67 2.67 -0.0% PASS
total/synth/LT/b1 1.39 1.39 -0.2% PASS
total/synth/MSIZE/a0 4.25 4.25 +0.0% PASS
total/synth/MSIZE/a1 4.66 4.68 +0.5% PASS
total/synth/MUL/b0 5.30 5.30 +0.1% PASS
total/synth/MUL/b1 5.29 5.29 +0.0% PASS
total/synth/NOT/u0 1.68 1.68 -0.0% PASS
total/synth/OR/b0 1.63 1.63 -0.1% PASS
total/synth/OR/b1 1.71 1.71 -0.1% PASS
total/synth/PC/a0 3.18 3.18 -0.1% PASS
total/synth/PC/a1 4.03 4.03 +0.1% PASS
total/synth/PUSH1/p0 0.83 1.07 +28.8% PASS
total/synth/PUSH1/p1 1.13 1.14 +0.2% PASS
total/synth/PUSH10/p0 0.85 1.07 +25.4% PASS
total/synth/PUSH10/p1 1.23 1.24 +0.2% PASS
total/synth/PUSH11/p0 0.83 0.84 +0.8% PASS
total/synth/PUSH11/p1 1.21 1.22 +0.3% PASS
total/synth/PUSH12/p0 0.83 0.83 -0.2% PASS
total/synth/PUSH12/p1 1.22 1.24 +1.3% PASS
total/synth/PUSH13/p0 0.85 1.07 +25.7% PASS
total/synth/PUSH13/p1 1.20 1.20 -0.1% PASS
total/synth/PUSH14/p0 0.88 0.92 +4.0% PASS
total/synth/PUSH14/p1 1.24 1.24 -0.1% PASS
total/synth/PUSH15/p0 1.07 0.84 -21.4% PASS
total/synth/PUSH15/p1 1.31 1.30 -0.4% PASS
total/synth/PUSH16/p0 1.07 0.84 -20.8% PASS
total/synth/PUSH16/p1 1.20 1.24 +3.0% PASS
total/synth/PUSH17/p0 0.85 0.86 +1.1% PASS
total/synth/PUSH17/p1 1.20 1.23 +2.6% PASS
total/synth/PUSH18/p0 0.83 1.07 +28.5% PASS
total/synth/PUSH18/p1 1.20 1.24 +2.8% PASS
total/synth/PUSH19/p0 1.07 0.85 -20.2% PASS
total/synth/PUSH19/p1 1.23 1.22 -0.6% PASS
total/synth/PUSH2/p0 0.83 0.83 +0.3% PASS
total/synth/PUSH2/p1 1.15 1.15 +0.0% PASS
total/synth/PUSH20/p0 0.83 0.84 +1.0% PASS
total/synth/PUSH20/p1 1.21 1.24 +2.5% PASS
total/synth/PUSH21/p0 0.85 0.85 +0.1% PASS
total/synth/PUSH21/p1 1.21 1.22 +0.9% PASS
total/synth/PUSH22/p0 1.07 1.07 +0.2% PASS
total/synth/PUSH22/p1 1.21 1.24 +1.9% PASS
total/synth/PUSH23/p0 0.85 1.07 +25.4% PASS
total/synth/PUSH23/p1 1.23 1.23 -0.2% PASS
total/synth/PUSH24/p0 0.83 1.07 +28.8% PASS
total/synth/PUSH24/p1 1.22 1.22 +0.4% PASS
total/synth/PUSH25/p0 0.85 0.85 -0.2% PASS
total/synth/PUSH25/p1 1.22 1.22 +0.1% PASS
total/synth/PUSH26/p0 1.07 0.93 -12.7% PASS
total/synth/PUSH26/p1 1.22 1.25 +2.3% PASS
total/synth/PUSH27/p0 0.83 1.07 +28.5% PASS
total/synth/PUSH27/p1 1.22 1.24 +1.3% PASS
total/synth/PUSH28/p0 1.07 0.89 -16.6% PASS
total/synth/PUSH28/p1 1.22 1.24 +1.8% PASS
total/synth/PUSH29/p0 1.07 1.07 +0.2% PASS
total/synth/PUSH29/p1 1.22 1.25 +2.1% PASS
total/synth/PUSH3/p0 0.83 0.95 +14.5% PASS
total/synth/PUSH3/p1 1.22 1.22 +0.1% PASS
total/synth/PUSH30/p0 1.07 0.96 -10.1% PASS
total/synth/PUSH30/p1 1.23 1.24 +1.5% PASS
total/synth/PUSH31/p0 0.85 0.85 +0.3% PASS
total/synth/PUSH31/p1 1.32 1.36 +3.8% PASS
total/synth/PUSH32/p0 0.83 0.87 +4.5% PASS
total/synth/PUSH32/p1 1.26 1.24 -1.1% PASS
total/synth/PUSH4/p0 1.07 1.07 -0.0% PASS
total/synth/PUSH4/p1 1.20 1.22 +2.1% PASS
total/synth/PUSH5/p0 0.97 0.85 -12.6% PASS
total/synth/PUSH5/p1 1.21 1.21 +0.1% PASS
total/synth/PUSH6/p0 0.83 1.07 +29.0% PASS
total/synth/PUSH6/p1 1.20 1.24 +2.8% PASS
total/synth/PUSH7/p0 1.07 0.94 -11.8% PASS
total/synth/PUSH7/p1 1.22 1.22 -0.2% PASS
total/synth/PUSH8/p0 0.83 0.83 +0.1% PASS
total/synth/PUSH8/p1 1.23 1.21 -1.2% PASS
total/synth/PUSH9/p0 0.84 0.85 +1.0% PASS
total/synth/PUSH9/p1 1.21 1.21 +0.1% PASS
total/synth/RETURNDATASIZE/a0 3.26 3.26 -0.0% PASS
total/synth/RETURNDATASIZE/a1 3.60 3.63 +0.6% PASS
total/synth/SAR/b0 3.77 3.77 +0.1% PASS
total/synth/SAR/b1 4.28 4.28 -0.0% PASS
total/synth/SGT/b0 2.60 2.60 +0.0% PASS
total/synth/SGT/b1 1.63 1.63 -0.0% PASS
total/synth/SHL/b0 3.05 3.04 -0.6% PASS
total/synth/SHL/b1 1.64 1.64 -0.2% PASS
total/synth/SHR/b0 3.10 3.11 +0.2% PASS
total/synth/SHR/b1 1.51 1.51 -0.0% PASS
total/synth/SIGNEXTEND/b0 3.38 3.37 -0.4% PASS
total/synth/SIGNEXTEND/b1 3.54 3.56 +0.6% PASS
total/synth/SLT/b0 2.58 2.58 -0.0% PASS
total/synth/SLT/b1 1.63 1.63 -0.0% PASS
total/synth/SUB/b0 1.94 1.94 +0.0% PASS
total/synth/SUB/b1 1.98 1.98 -0.0% PASS
total/synth/SWAP1/s0 1.49 1.49 +0.0% PASS
total/synth/SWAP10/s0 1.50 1.50 -0.1% PASS
total/synth/SWAP11/s0 1.51 1.50 -0.0% PASS
total/synth/SWAP12/s0 1.51 1.51 -0.1% PASS
total/synth/SWAP13/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP14/s0 1.51 1.51 -0.0% PASS
total/synth/SWAP15/s0 1.51 1.51 +0.0% PASS
total/synth/SWAP16/s0 1.51 1.51 -0.1% PASS
total/synth/SWAP2/s0 1.49 1.49 -0.2% PASS
total/synth/SWAP3/s0 1.49 1.49 +0.1% PASS
total/synth/SWAP4/s0 1.49 1.49 -0.1% PASS
total/synth/SWAP5/s0 1.49 1.49 -0.1% PASS
total/synth/SWAP6/s0 1.50 1.49 -0.1% PASS
total/synth/SWAP7/s0 1.50 1.50 +0.0% PASS
total/synth/SWAP8/s0 1.50 1.50 -0.0% PASS
total/synth/SWAP9/s0 1.50 1.50 -0.1% PASS
total/synth/XOR/b0 1.55 1.55 +0.0% PASS
total/synth/XOR/b1 1.56 1.55 -0.7% PASS
total/synth/loop_v1 4.75 4.76 +0.1% PASS
total/synth/loop_v2 4.75 4.75 +0.1% PASS

Summary: 194 benchmarks, 0 regressions


✅ Performance Check Passed (multipass)

Performance Benchmark Results (threshold: 25%)

Benchmark Baseline (us) Current (us) Change Status
total/main/blake2b_huff/8415nulls 1.54 1.63 +6.1% PASS
total/main/blake2b_huff/empty 0.10 0.10 +0.9% PASS
total/main/blake2b_shifts/8415nulls 5.22 5.28 +1.1% PASS
total/main/sha1_divs/5311 1.90 1.90 -0.0% PASS
total/main/sha1_divs/empty 0.03 0.03 -0.4% PASS
total/main/sha1_shifts/5311 2.76 2.76 -0.0% PASS
total/main/sha1_shifts/empty 0.04 0.04 -0.3% PASS
total/main/snailtracer/benchmark 52.20 52.83 +1.2% PASS
total/main/structarray_alloc/nfts_rank 0.29 0.29 +0.0% PASS
total/main/swap_math/insufficient_liquidity 0.02 0.02 +0.0% PASS
total/main/swap_math/received 0.02 0.02 +0.6% PASS
total/main/swap_math/spent 0.02 0.02 +0.2% PASS
total/main/weierstrudel/1 0.39 0.39 +0.2% PASS
total/main/weierstrudel/15 3.23 3.30 +2.1% PASS
total/micro/JUMPDEST_n0/empty 0.14 0.13 -0.9% PASS
total/micro/jump_around/empty 0.62 0.62 -0.1% PASS
total/micro/loop_with_many_jumpdests/empty 1.97 1.96 -0.5% PASS
total/micro/memory_grow_mload/by1 0.20 0.18 -12.1% PASS
total/micro/memory_grow_mload/by16 0.19 0.19 -0.3% PASS
total/micro/memory_grow_mload/by32 0.24 0.24 -0.3% PASS
total/micro/memory_grow_mload/nogrow 0.18 0.18 -0.1% PASS
total/micro/memory_grow_mstore/by1 0.19 0.21 +13.7% PASS
total/micro/memory_grow_mstore/by16 0.20 0.20 -0.7% PASS
total/micro/memory_grow_mstore/by32 0.22 0.22 +0.0% PASS
total/micro/memory_grow_mstore/nogrow 0.18 0.21 +13.1% PASS
total/micro/signextend/one 0.35 0.38 +7.3% PASS
total/micro/signextend/zero 0.37 0.35 -6.8% PASS
total/synth/ADD/b0 0.01 0.01 -0.3% PASS
total/synth/ADD/b1 0.01 0.01 -0.1% PASS
total/synth/ADDRESS/a0 0.16 0.16 -0.4% PASS
total/synth/ADDRESS/a1 0.16 0.16 -0.0% PASS
total/synth/AND/b0 0.01 0.01 -0.2% PASS
total/synth/AND/b1 0.01 0.01 -0.1% PASS
total/synth/BYTE/b0 1.96 1.96 -0.0% PASS
total/synth/BYTE/b1 2.33 2.32 -0.4% PASS
total/synth/CALLDATASIZE/a0 0.08 0.08 +2.8% PASS
total/synth/CALLDATASIZE/a1 0.08 0.08 +2.8% PASS
total/synth/CALLER/a0 0.16 0.16 -0.1% PASS
total/synth/CALLER/a1 0.16 0.16 +0.1% PASS
total/synth/CALLVALUE/a0 0.27 0.27 -0.0% PASS
total/synth/CALLVALUE/a1 0.28 0.28 -0.0% PASS
total/synth/CODESIZE/a0 0.08 0.08 -0.0% PASS
total/synth/CODESIZE/a1 0.08 0.08 -0.1% PASS
total/synth/DUP1/d0 0.01 0.01 -0.0% PASS
total/synth/DUP1/d1 0.01 0.01 -0.2% PASS
total/synth/DUP10/d0 0.01 0.01 -0.1% PASS
total/synth/DUP10/d1 0.01 0.01 -0.1% PASS
total/synth/DUP11/d0 0.01 0.01 -0.5% PASS
total/synth/DUP11/d1 0.01 0.01 +0.2% PASS
total/synth/DUP12/d0 0.01 0.01 -0.2% PASS
total/synth/DUP12/d1 0.01 0.01 -0.1% PASS
total/synth/DUP13/d0 0.01 0.01 -0.1% PASS
total/synth/DUP13/d1 0.01 0.01 -0.1% PASS
total/synth/DUP14/d0 0.01 0.01 -0.0% PASS
total/synth/DUP14/d1 0.01 0.01 -0.1% PASS
total/synth/DUP15/d0 0.01 0.01 -0.2% PASS
total/synth/DUP15/d1 0.01 0.01 -0.0% PASS
total/synth/DUP16/d0 0.01 0.01 -0.1% PASS
total/synth/DUP16/d1 0.01 0.01 -0.1% PASS
total/synth/DUP2/d0 0.01 0.01 -0.1% PASS
total/synth/DUP2/d1 0.01 0.01 -0.3% PASS
total/synth/DUP3/d0 0.01 0.01 -0.2% PASS
total/synth/DUP3/d1 0.01 0.01 +0.0% PASS
total/synth/DUP4/d0 0.01 0.01 -0.0% PASS
total/synth/DUP4/d1 0.01 0.01 -0.0% PASS
total/synth/DUP5/d0 0.01 0.01 -0.1% PASS
total/synth/DUP5/d1 0.01 0.01 -0.1% PASS
total/synth/DUP6/d0 0.01 0.01 -0.1% PASS
total/synth/DUP6/d1 0.01 0.01 +0.0% PASS
total/synth/DUP7/d0 0.01 0.01 -0.0% PASS
total/synth/DUP7/d1 0.01 0.01 -0.2% PASS
total/synth/DUP8/d0 0.01 0.01 -0.0% PASS
total/synth/DUP8/d1 0.01 0.01 -0.2% PASS
total/synth/DUP9/d0 0.01 0.01 -0.1% PASS
total/synth/DUP9/d1 0.01 0.01 -0.2% PASS
total/synth/EQ/b0 0.01 0.01 -0.0% PASS
total/synth/EQ/b1 0.01 0.01 -0.1% PASS
total/synth/GAS/a0 0.80 0.80 +0.1% PASS
total/synth/GAS/a1 0.76 0.76 -0.0% PASS
total/synth/GT/b0 0.01 0.01 -0.1% PASS
total/synth/GT/b1 0.01 0.01 -0.1% PASS
total/synth/ISZERO/u0 0.01 0.01 +0.0% PASS
total/synth/JUMPDEST/n0 0.13 0.13 -0.1% PASS
total/synth/LT/b0 0.01 0.01 -0.2% PASS
total/synth/LT/b1 0.01 0.01 -0.2% PASS
total/synth/MSIZE/a0 0.01 0.01 -0.0% PASS
total/synth/MSIZE/a1 0.01 0.01 -0.1% PASS
total/synth/MUL/b0 0.01 0.01 +0.0% PASS
total/synth/MUL/b1 0.01 0.01 -0.1% PASS
total/synth/NOT/u0 0.01 0.01 -0.0% PASS
total/synth/OR/b0 0.01 0.01 -0.1% PASS
total/synth/OR/b1 0.01 0.01 -0.1% PASS
total/synth/PC/a0 0.01 0.01 -0.0% PASS
total/synth/PC/a1 0.01 0.01 -0.0% PASS
total/synth/PUSH1/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH1/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH10/p0 0.01 0.01 +0.2% PASS
total/synth/PUSH10/p1 0.01 0.01 -0.2% PASS
total/synth/PUSH11/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH11/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH12/p0 0.01 0.01 -1.4% PASS
total/synth/PUSH12/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH13/p0 0.01 0.01 -0.3% PASS
total/synth/PUSH13/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH14/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH14/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH15/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH15/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH16/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH16/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH17/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH17/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH18/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH18/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH19/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH19/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH2/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH2/p1 0.01 0.01 -0.2% PASS
total/synth/PUSH20/p0 0.01 0.01 -0.1% PASS
total/synth/PUSH20/p1 0.01 0.01 +0.0% PASS
total/synth/PUSH21/p0 0.01 0.01 -0.0% PASS
total/synth/PUSH21/p1 0.01 0.01 +0.6% PASS
total/synth/PUSH22/p0 1.08 1.10 +2.3% PASS
total/synth/PUSH22/p1 1.25 1.25 -0.4% PASS
total/synth/PUSH23/p0 1.08 1.11 +2.7% PASS
total/synth/PUSH23/p1 1.25 1.25 +0.5% PASS
total/synth/PUSH24/p0 1.08 1.08 +0.2% PASS
total/synth/PUSH24/p1 1.28 1.25 -2.6% PASS
total/synth/PUSH25/p0 1.08 1.08 -0.0% PASS
total/synth/PUSH25/p1 1.24 1.28 +3.5% PASS
total/synth/PUSH26/p0 0.86 0.88 +2.8% PASS
total/synth/PUSH26/p1 1.25 1.29 +2.9% PASS
total/synth/PUSH27/p0 1.08 1.08 +0.0% PASS
total/synth/PUSH27/p1 1.25 1.25 -0.1% PASS
total/synth/PUSH28/p0 1.08 1.08 +0.1% PASS
total/synth/PUSH28/p1 1.26 1.28 +2.1% PASS
total/synth/PUSH29/p0 1.08 1.08 +0.1% PASS
total/synth/PUSH29/p1 1.27 1.29 +1.6% PASS
total/synth/PUSH3/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH3/p1 0.01 0.01 -0.1% PASS
total/synth/PUSH30/p0 1.09 1.08 -0.9% PASS
total/synth/PUSH30/p1 1.25 1.25 +0.1% PASS
total/synth/PUSH31/p0 1.11 1.08 -2.3% PASS
total/synth/PUSH31/p1 1.31 1.35 +3.3% PASS
total/synth/PUSH32/p0 1.08 1.08 -0.1% PASS
total/synth/PUSH32/p1 1.25 1.29 +3.3% PASS
total/synth/PUSH4/p0 0.01 0.01 -0.3% PASS
total/synth/PUSH4/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH5/p0 0.01 0.01 +0.1% PASS
total/synth/PUSH5/p1 0.01 0.01 -0.3% PASS
total/synth/PUSH6/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH6/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH7/p0 0.01 0.01 -0.0% PASS
total/synth/PUSH7/p1 0.01 0.01 +0.1% PASS
total/synth/PUSH8/p0 0.01 0.01 -0.3% PASS
total/synth/PUSH8/p1 0.01 0.01 -0.0% PASS
total/synth/PUSH9/p0 0.01 0.01 -0.2% PASS
total/synth/PUSH9/p1 0.01 0.01 -0.1% PASS
total/synth/RETURNDATASIZE/a0 0.53 0.53 +0.5% PASS
total/synth/RETURNDATASIZE/a1 0.49 0.49 +0.2% PASS
total/synth/SAR/b0 3.78 3.81 +0.8% PASS
total/synth/SAR/b1 4.29 4.33 +0.9% PASS
total/synth/SGT/b0 0.01 0.01 -0.1% PASS
total/synth/SGT/b1 0.01 0.01 -0.1% PASS
total/synth/SHL/b0 3.06 3.10 +1.0% PASS
total/synth/SHL/b1 1.64 1.64 -0.4% PASS
total/synth/SHR/b0 3.11 3.11 -0.0% PASS
total/synth/SHR/b1 1.52 1.55 +1.6% PASS
total/synth/SIGNEXTEND/b0 3.12 3.17 +1.3% PASS
total/synth/SIGNEXTEND/b1 3.56 3.60 +1.2% PASS
total/synth/SLT/b0 0.01 0.01 -0.1% PASS
total/synth/SLT/b1 0.01 0.01 -0.1% PASS
total/synth/SUB/b0 0.01 0.01 +0.2% PASS
total/synth/SUB/b1 0.01 0.01 -0.1% PASS
total/synth/SWAP1/s0 0.01 0.01 +0.2% PASS
total/synth/SWAP10/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP11/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP12/s0 0.01 0.01 +0.0% PASS
total/synth/SWAP13/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP14/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP15/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP16/s0 0.01 0.01 -0.2% PASS
total/synth/SWAP2/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP3/s0 0.01 0.01 +0.2% PASS
total/synth/SWAP4/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP5/s0 0.01 0.01 -0.0% PASS
total/synth/SWAP6/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP7/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP8/s0 0.01 0.01 -0.1% PASS
total/synth/SWAP9/s0 0.01 0.01 -0.1% PASS
total/synth/XOR/b0 0.01 0.01 +0.1% PASS
total/synth/XOR/b1 0.01 0.01 -0.0% PASS
total/synth/loop_v1 1.41 1.41 +0.0% PASS
total/synth/loop_v2 1.34 1.33 -0.4% PASS

Summary: 194 benchmarks, 0 regressions


@zoowii zoowii requested a review from Copilot March 19, 2026 10:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a lightweight instrumentation summary for EVM memory-related MIR compilation, emitting counters that help diagnose how often memory expansion/size reload/pointer fetch logic is generated during compilation.

Changes:

  • Introduces EVMMirBuilder::MemoryCompileStats counters and increments them at key memory-compilation sites.
  • Adds EVMMirBuilder::dumpMemoryCompileStats() to emit a single summary log line when counters are non-zero.
  • Calls the dump hook after EVM MIR compilation completes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/compiler/evm_frontend/evm_mir_compiler.h Declares stats struct/counters and the dumpMemoryCompileStats() API on EVMMirBuilder.
src/compiler/evm_frontend/evm_mir_compiler.cpp Increments stats counters and implements hasMemoryCompileStats() + summary debug logging.
src/compiler/evm_compiler.cpp Invokes dumpMemoryCompileStats() after MIR building.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4065 to +4075
ZEN_LOG_DEBUG(
"[EVM-MEM-SUMMARY] mload_expand=%llu mstore_expand=%llu "
"mstore8_expand=%llu mcopy_expand=%llu reload_mem_size=%llu "
"get_mem_ptr=%llu need_expand_cfg=%llu",
static_cast<unsigned long long>(MemStats.MLoadExpandCount),
static_cast<unsigned long long>(MemStats.MStoreExpandCount),
static_cast<unsigned long long>(MemStats.MStore8ExpandCount),
static_cast<unsigned long long>(MemStats.MCopyExpandCount),
static_cast<unsigned long long>(MemStats.ReloadMemorySizeCount),
static_cast<unsigned long long>(MemStats.GetMemoryDataPointerCount),
static_cast<unsigned long long>(MemStats.ExpandNeedExpandCFGCount));
Comment on lines 46 to +47
MIRBuilder.compile(&Ctx);
MIRBuilder.dumpMemoryCompileStats();
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds block-level EVM memory compilation diagnostics and introduces a first-wave block-local memory precheck optimization for eligible “pure direct-memory” basic blocks, aiming to reduce redundant per-op memory expansion CFG.

Changes:

  • Adds memory compile summary + per-basic-block memory instrumentation in EVMMirBuilder.
  • Implements a block-local const precheck plan to hoist a single expandMemoryIR() for eligible blocks and skip per-op expansion checks.
  • Extends the bytecode visitor with a conservative block scan to detect constant-address direct-memory patterns and emit precheck plans.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/compiler/evm_frontend/evm_mir_compiler.h Declares memory compile stats structs and block-precheck APIs/states.
src/compiler/evm_frontend/evm_mir_compiler.cpp Implements stats logging, block tracking, and const precheck emission/consumption.
src/compiler/evm_compiler.cpp Dumps memory compile summary after MIR build when logging is enabled.
src/action/evm_bytecode_visitor.h Adds block scanning for const-address direct-memory blocks and hooks for block begin/end + opcode notes.
openspec/changes/update-evm-memory-block-precheck/tasks.md Tracking/tasks doc for the new optimization work.
openspec/changes/update-evm-memory-block-precheck/specs/evm-jit/spec.md Spec requirements for the block-local precheck behavior and diagnostics.
openspec/changes/update-evm-memory-block-precheck/proposal.md Proposal/motivation and scope for the optimization.
openspec/changes/update-evm-memory-block-precheck/design.md Design/eligibility/risks/validation plan for the optimization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4258 to +4260
MInstruction *RequiredSize = createIntConstInstruction(
I64Type, CurBlockConstPrecheckPlan.MaxRequiredSize);
MInstruction *NoOverflow = createIntConstInstruction(I64Type, 0);
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expandMemoryIR(RequiredSize, Overflow) is invoked elsewhere with Overflow coming from a CmpInstruction (i.e., a boolean/i1). Here, NoOverflow is created as an i64 constant, which is very likely a type mismatch for the branch/condition inside expandMemoryIR and can break verification or generate incorrect IR. Use an i1 false constant (or the project’s boolean-const helper) for the overflow argument.

Suggested change
MInstruction *RequiredSize = createIntConstInstruction(
I64Type, CurBlockConstPrecheckPlan.MaxRequiredSize);
MInstruction *NoOverflow = createIntConstInstruction(I64Type, 0);
MType *I1Type = &Ctx.I1Type;
MInstruction *RequiredSize = createIntConstInstruction(
I64Type, CurBlockConstPrecheckPlan.MaxRequiredSize);
MInstruction *NoOverflow = createIntConstInstruction(I1Type, 0);

Copilot uses AI. Check for mistakes.
}

static bool isBlockTerminatorOpcode(evmc_opcode Opcode) {
return Opcode == OP_JUMP || Opcode == OP_RETURN || Opcode == OP_STOP ||
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OP_JUMPI is a basic-block terminator in EVM. Omitting it means analyzeConstDirectMemoryBlockPrecheck(...) can scan past the end of the current basic block into the fallthrough block (which does not necessarily start with JUMPDEST), potentially (a) incorrectly disqualifying eligible blocks, or worse (b) computing a max-required-size that includes operations not guaranteed to execute on all paths, changing gas/behavior if precheck is emitted. Include OP_JUMPI as a terminator (and any other terminators your analyzer recognizes).

Suggested change
return Opcode == OP_JUMP || Opcode == OP_RETURN || Opcode == OP_STOP ||
return Opcode == OP_JUMP || Opcode == OP_JUMPI ||
Opcode == OP_RETURN || Opcode == OP_STOP ||

Copilot uses AI. Check for mistakes.
Comment on lines +853 to +882
case OP_PUSH9:
case OP_PUSH10:
case OP_PUSH11:
case OP_PUSH12:
case OP_PUSH13:
case OP_PUSH14:
case OP_PUSH15:
case OP_PUSH16:
case OP_PUSH17:
case OP_PUSH18:
case OP_PUSH19:
case OP_PUSH20:
case OP_PUSH21:
case OP_PUSH22:
case OP_PUSH23:
case OP_PUSH24:
case OP_PUSH25:
case OP_PUSH26:
case OP_PUSH27:
case OP_PUSH28:
case OP_PUSH29:
case OP_PUSH30:
case OP_PUSH31:
case OP_PUSH32: {
uint8_t NumBytes =
static_cast<uint8_t>(Opcode) - static_cast<uint8_t>(OP_PUSH0);
ScanPC += NumBytes;
SimStack.push_back(makeUnknownConstU64());
break;
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path skips immediate bytes without checking ScanPC + NumBytes <= BytecodeSize. If the bytecode is malformed/truncated, the scan can incorrectly proceed and potentially mark a block eligible based on earlier state. For consistency with parsePushConstU64(...), add a bounds check and return {} when the immediate would exceed BytecodeSize.

Copilot uses AI. Check for mistakes.
Comment on lines 4282 to +4286
MInstruction *EVMMirBuilder::getMemoryDataPointer() {
++MemStats.GetMemoryDataPointerCount;
if (CurBlockMemStats.Active) {
CurBlockMemStats.GetMemPtrCount++;
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All stats counters and block tracking are updated unconditionally, even when ZEN_ENABLE_MULTIPASS_JIT_LOGGING is off (and dumpMemoryCompileStats() won’t emit anything). This adds overhead and increases EVMMirBuilder size in non-logging builds. Consider compiling stats fields + counter increments behind ZEN_ENABLE_MULTIPASS_JIT_LOGGING (or a dedicated instrumentation macro), or using a compile-time constant to fully optimize them out.

Copilot uses AI. Check for mistakes.
Comment on lines 690 to +701
void handleBeginBlock(EVMAnalyzer &Analyzer) {
const auto &BlockInfos = Analyzer.getBlockInfos();
ZEN_ASSERT(BlockInfos.count(PC) > 0 && "Block info not found");
Builder.beginMemoryCompileBlock(PC);
const Byte *Bytecode = Ctx->getBytecode();
size_t BytecodeSize = Ctx->getBytecodeSize();
BlockConstPrecheckPlan PrecheckPlan =
analyzeConstDirectMemoryBlockPrecheck(Bytecode, BytecodeSize, PC);
if (PrecheckPlan.Eligible) {
Builder.setMemoryCompileBlockConstPrecheckPlan(
PrecheckPlan.MaxRequiredSize, PrecheckPlan.CoveredDirectOps);
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title/description reads like it only adds an instrumentation summary, but this change introduces a behavior-changing optimization (block-local memory precheck planning + skipping per-op expansion checks). Please update the PR description/title and (if applicable per repo conventions) add a release note entry to reflect the optimization and its scope/constraints.

Copilot uses AI. Check for mistakes.
ECNUyhy added 5 commits March 26, 2026 12:49
…ory ops

Detect simple constant-address direct-memory blocks in the EVM bytecode visitor and install a block-local precheck plan before MIR generation.

Reuse the existing expandMemoryIR path so covered MLOAD, MSTORE, and MSTORE8 ops share one precheck instead of emitting redundant per-op expansion CFG. Keep helper-sensitive, MCOPY, and dynamic-address blocks on the original path and retain development diagnostics behind the existing logging guard.
@zoowii zoowii merged commit 2c75743 into DTVMStack:main Mar 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants