Skip to content

cmake: Raise GCC's inline budget for the Baseline interpreter - #1814

Merged
chfast merged 1 commit into
masterfrom
baseline/gcc-inline-budget
Nov 16, 2026
Merged

chfast merged 1 commit into
masterfrom
baseline/gcc-inline-budget

Conversation

@chfast

@chfast chfast commented Nov 16, 2026

Copy link
Copy Markdown
Member

GCC inlines functions into a file only until it has grown by inline-unit-growth (40%), and into a large function only until that has grown by large-function-growth (100%). The Baseline dispatch loops in baseline_execution.cpp reach these limits: LOG1-LOG4, CALLDATACOPY, CODECOPY, EXTCODECOPY, MCOPY, RETURNDATACOPY and SAR are called out of line, and any change of code size, e.g. in intx, moves instructions in or out of the loops.

Raise the limits for this file with GCC to 100% and 200%. The loops then call only the instructions defined in other files and the largest ones (EXP, SELFDESTRUCT, the intx division, and SDIV and SMOD at x86-64-v2), the same as with ten times the limits.

GCC inlines functions into a file only until it has grown by
inline-unit-growth (40%), and into a large function only until that has
grown by large-function-growth (100%). The Baseline dispatch loops in
baseline_execution.cpp reach these limits: LOG1-LOG4, CALLDATACOPY,
CODECOPY, EXTCODECOPY, MCOPY, RETURNDATACOPY and SAR are called out of
line, and any change of code size, e.g. in intx, moves instructions in
or out of the loops.

Raise the limits for this file with GCC to 100% and 200%. The loops
then call only the instructions defined in other files and the largest
ones (EXP, SELFDESTRUCT, the intx division, and SDIV and SMOD at
x86-64-v2), the same as with ten times the limits.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

There are no active review issues for the GCC-only Baseline inlining-limit change.

No open issues 🎉

What changed in this PR

Raises GCC’s inlining limits for the Baseline interpreter to reduce out-of-line instruction calls and make inlining less sensitive to code-size changes.

Changes:

  • Sets inline-unit-growth to 100% and large-function-growth to 200% for baseline_execution.cpp.
  • Applies the options only to GCC and documents the rationale.
File Description
lib/​evmone/​CMakeLists.txt Adds GCC-only, source-specific inlining limits for the Baseline interpreter.

Review effort: Balanced

@codspeed

codspeed Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will regress 4 benchmarks

1 warning

⚠️ 168 benchmarks with a significant change ran on different hardware

Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.

Learn more about Macro Runners

See affected benchmarks

⚡ 164 improved benchmarks
❌ 4 regressed benchmarks
✅ 731 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
❌ test_bitwise[fork_Osaka-blockchain_test-opcode_SAR--benchmark-gas-value_1M] 17.2 ms 17.8 ms -3.56%
❌ test_shifts[fork_Osaka-blockchain_test-opcode_SAR-benchmark-gas-value_1M] 14.9 ms 15.3 ms -2.8%
❌ test_arithmetic[fork_Osaka-blockchain_test-opcode_MUL--benchmark-gas-value_1M] 13.1 ms 13.4 ms -1.82%
❌ test_bitwise[fork_Osaka-blockchain_test-opcode_SHL--benchmark-gas-value_1M] 12.6 ms 12.8 ms -1.73%
⚡ test_block_context_ops[fork_Osaka-blockchain_test-opcode_TIMESTAMP-benchmark-gas-value_1M] 16.1 ms 13.5 ms +19.55%
⚡ test_calldatacopy_from_origin[fork_Osaka-blockchain_test-calldata_size_0-fixed_src_dst_True-mem_size_10240-benchmark-gas-value_1M] 10.5 ms 9 ms +17.14%
⚡ test_calldatacopy_from_origin[fork_Osaka-blockchain_test-calldata_size_0-fixed_src_dst_True-mem_size_32-benchmark-gas-value_1M] 10.5 ms 9 ms +17.13%
⚡ test_calldatacopy_from_origin[fork_Osaka-blockchain_test-calldata_size_0-fixed_src_dst_True-mem_size_1048576-benchmark-gas-value_1M] 10.6 ms 9 ms +17.13%
⚡ test_calldatacopy_from_origin[fork_Osaka-blockchain_test-calldata_size_0-fixed_src_dst_True-mem_size_1024-benchmark-gas-value_1M] 10.6 ms 9 ms +17.12%
⚡ test_calldatacopy_from_origin[fork_Osaka-blockchain_test-calldata_size_0-fixed_src_dst_True-mem_size_0-benchmark-gas-value_1M] 10.6 ms 9 ms +17.12%
⚡ test_calldatacopy_from_origin[fork_Osaka-blockchain_test-calldata_size_0-fixed_src_dst_True-mem_size_256-benchmark-gas-value_1M] 10.6 ms 9 ms +17.1%
⚡ test_codecopy_benchmark[fork_Osaka-blockchain_test-code_size_0-mem_size_0-benchmark-gas-value_1M] 10.7 ms 9.2 ms +15.19%
⚡ test_codecopy_benchmark[fork_Osaka-blockchain_test-code_size_0-mem_size_256-benchmark-gas-value_1M] 10.7 ms 9.2 ms +15.19%
⚡ test_codecopy_benchmark[fork_Osaka-blockchain_test-code_size_0-mem_size_1024-benchmark-gas-value_1M] 10.7 ms 9.3 ms +15.17%
⚡ test_codecopy_benchmark[fork_Osaka-blockchain_test-code_size_0-mem_size_32-benchmark-gas-value_1M] 10.7 ms 9.3 ms +15.16%
⚡ test_codecopy[fork_Osaka-blockchain_test-fixed_src_dst_True-0 bytes-benchmark-gas-value_1M] 9.2 ms 8 ms +14.56%
⚡ test_block_context_ops[fork_Osaka-blockchain_test-opcode_NUMBER-benchmark-gas-value_1M] 16 ms 14.1 ms +13.7%
⚡ test_block_context_ops[fork_Osaka-blockchain_test-opcode_GASLIMIT-benchmark-gas-value_1M] 16.1 ms 14.1 ms +13.67%
⚡ test_returndatacopy[fork_Osaka-blockchain_test-fixed_dst_True-return_size_32-mem_size_32-benchmark-gas-value_1M] 11.7 ms 10.3 ms +13.05%
⚡ test_returndatacopy[fork_Osaka-blockchain_test-fixed_dst_True-return_size_32-mem_size_256-benchmark-gas-value_1M] 11.7 ms 10.4 ms +13.05%
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing baseline/gcc-inline-budget (6640f6e) with master (6fb712f)

Open in CodSpeed

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.23%. Comparing base (6fb712f) to head (6640f6e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1814   +/-   ##
=======================================
  Coverage   98.23%   98.23%           
=======================================
  Files         186      186           
  Lines       17192    17192           
  Branches     3963     3963           
=======================================
  Hits        16888    16888           
  Misses        235      235           
  Partials       69       69           
Flag Coverage Δ
eest-develop-gmp 26.75% <ø> (ø)
eest-legacy 17.21% <ø> (ø)
eest-libsecp256k1 28.72% <ø> (ø)
eest-stable 83.74% <ø> (ø)
evmone-unittests 93.94% <ø> (ø)
riscv64 94.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
core 96.60% <ø> (ø)
tooling 94.87% <ø> (ø)
tests 99.80% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chfast
chfast merged commit ba92871 into master Nov 16, 2026
30 of 32 checks passed
@chfast
chfast deleted the baseline/gcc-inline-budget branch November 16, 2026 11:07
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.

2 participants