Skip to content

Conversation

@PavelKopyl
Copy link
Contributor

@PavelKopyl PavelKopyl commented Oct 9, 2024

This includes:

  • splitting of critical edges
  • CFG implementation
  • stack shuffler with unittest
  • stack layout generator
  • optimized code transform
  • proper ordering of ARGUMENT instructions

Code Review Checklist

Purpose

Ticket Number

Requirements

  • Have the requirements been met?
  • Have stakeholder(s) approved the change?

Implementation

  • Does this code change accomplish what it is supposed to do?
  • Can this solution be simplified?
  • Does this change add unwanted compile-time or run-time dependencies?
  • Could an additional framework, API, library, or service improve the solution?
  • Could we reuse part of LLVM instead of implementing the patch or a part of it?
  • Is the code at the right abstraction level?
  • Is the code modular enough?
  • Can a better solution be found in terms of maintainability, readability, performance, or security?
  • Does similar functionality already exist in the codebase? If yes, why isn’t it reused?
  • Are there any best practices, design patterns or language-specific patterns that could substantially improve this code?

Logic Errors and Bugs

  • Can you think of any use case in which the
    code does not behave as intended?
  • Can you think of any inputs or external events
    that could break the code?

Error Handling and Logging

  • Is error handling done the correct way?
  • Should any logging or debugging information
    be added or removed?
  • Are error messages user-friendly?
  • Are there enough log events and are they
    written in a way that allows for easy
    debugging?

Maintainability

  • Is the code easy to read?
  • Is the code not repeated (DRY Principle)?
  • Is the code method/class not too long?

Dependencies

  • Were updates to documentation, configuration, or readme files made as required by this change?
  • Are there any potential impacts on other parts of the system or backward compatibility?

Security

  • Does the code introduce any security vulnerabilities?

Performance

  • Do you think this code change decreases
    system performance?
  • Do you see any potential to improve the
    performance of the code significantly?

Testing and Testability

  • Is the code testable?
  • Have automated tests been added, or have related ones been updated to cover the change?
    • For changes to mutable state
  • Do tests reasonably cover the code change (unit/integration/system tests)?
    • Line Coverage
    • Region Coverage
    • Branch Coverage
  • Are there some test cases, input or edge cases
    that should be tested in addition?

Readability

  • Is the code easy to understand?
  • Which parts were confusing to you and why?
  • Can the readability of the code be improved by
    smaller methods?
  • Can the readability of the code be improved by
    different function, method or variable names?
  • Is the code located in the right
    file/folder/package?
  • Do you think certain methods should be
    restructured to have a more intuitive control
    flow?
  • Is the data flow understandable?
  • Are there redundant or outdated comments?
  • Could some comments convey the message
    better?
  • Would more comments make the code more
    understandable?
  • Could some comments be removed by making the code itself more readable?
  • Is there any commented-out code?
  • Have you run a spelling and grammar checker?

Documentation

  • Is there sufficient documentation?
  • Is the ReadMe.md file up to date?

Best Practices

  • Follow Single Responsibility principle?
  • Are different errors handled correctly?
  • Are errors and warnings logged?
  • Magic values avoided?
  • No unnecessary comments?
  • Minimal nesting used?

Experts' Opinion

  • Do you think a specific expert, like a security
    expert or a usability expert, should look over
    the code before it can be accepted?
  • Will this code change impact different teams, and should they review the change as well?

@PavelKopyl PavelKopyl requested a review from akiramenai October 9, 2024 18:31
@PavelKopyl PavelKopyl marked this pull request as draft October 9, 2024 18:31
@PavelKopyl PavelKopyl changed the title [EVM] Add Ethereum stackification [EVM] [DO NOT MERGE] Add Ethereum stackification Oct 9, 2024
@github-actions
Copy link

github-actions bot commented Oct 9, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@akiramenai akiramenai left a comment

Choose a reason for hiding this comment

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

Please handle dead arguments properly.
Example:

; Function Attrs: nounwind
define i256 @foo(i256 %a1, i256 %a2, i256 %a3) #0 {
  %x1 = add i256 %a1, %a1
  ret i256 %x1
}

; Function Attrs: nounwind
define i256 @wat(i256 %a1, i256 %a2, i256 %a3) #0 {
  %x1 = add i256 %a2, %a2
  ret i256 %x1
}

; Function Attrs: nounwind
define i256 @wat2(i256 %a1, i256 %a2, i256 %a3) #0 {
  %x1 = add i256 %a2, %a3
  ret i256 %x1
}

; Function Attrs: nounwind
define i256 @bar() #0 {
  %res = call i256 @foo(i256 1, i256 2, i256 3)
  ret i256 %res
}

Codegen:

foo:                                    ; @foo
; %bb.0:
	JUMPDEST
	DUP1
	ADD
	SWAP1
	JUMP
                                        ; -- End function
	.globl	wat                             ; -- Begin function wat
wat:                                    ; @wat
; %bb.0:
	JUMPDEST
	DUP1
	ADD
	SWAP1
	JUMP
                                        ; -- End function
	.globl	wat2                            ; -- Begin function wat2
wat2:                                   ; @wat2
; %bb.0:
	JUMPDEST
	SWAP1
	ADD
	SWAP1
	JUMP
                                        ; -- End function
	.globl	bar                             ; -- Begin function bar
bar:                                    ; @bar
; %bb.0:
	JUMPDEST
	PUSH4 @.FUNC_RET0
	PUSH1 3
	PUSH1 2
	PUSH1 1
	PUSH4 @foo
	JUMP
.FUNC_RET0:
	JUMPDEST
	SWAP1
	JUMP

@PavelKopyl PavelKopyl force-pushed the ef-stackification branch 2 times, most recently from ff232c6 to 5771d35 Compare November 16, 2024 09:07
@PavelKopyl PavelKopyl force-pushed the ef-stackification branch 3 times, most recently from fe7ccda to 5a7e27f Compare November 25, 2024 17:58
@akiramenai akiramenai force-pushed the ef-stackification branch 2 times, most recently from ae49567 to 026ee9a Compare January 27, 2025 20:23
PavelKopyl and others added 13 commits February 6, 2025 17:29
ARGUMENT instructions should always be located at the beginning
of a MF`s entry basic block and be ordered in ascending order
of their operand values.
Original idea and some code parts were taken from
the Ethereum`s compiler (solc) stackification algorithm.
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
This patch adds pseudo jumps, call and ret instructions
to fix machine verifier after stackification and to
reduce complexity added with bundles.

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
PavelKopyl and others added 8 commits February 6, 2025 17:36
- Removed EVMControlFlowGraph/EVMControlFlowGraphBuilder classes
- Functionality that analyzes machine CFG and provides query methods
  was moved to EVMMachineCFGInfo class
- Information about MBB terminators is represented in EVMMBBTerminatorsInfo
  class
- StackSlot, Stack and Operation definitions  were moved to EVMStackModel
- Replaced almost all the std::map/std::set with llvm counterparts in
  EVMStackLayoutGenerator
Update assert to reflect support for libraries.

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
* Remove TemporarySlot
* Refactor createOperation
* Remove Output field from Operation
@github-actions
Copy link

github-actions bot commented Feb 7, 2025

Results for: evm ir-llvm EVMInterpreter
╔═╡ Size (-%) ╞═══════════════════════╡ All Y +M3B3 ╞═╗
║ Best                                         57.463 ║
║ Worst                                       -373.667 ║
║ Total                                       -14.376 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All Y +M3B3 ╞═╣
║ Best                                         83.400 ║
║ Worst                                       -176.976 ║
║ Total                                         0.605 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All Y +M3B3 ╞═╣
║ Best                                         80.122 ║
║ Worst                                       -165.620 ║
║ Total                                         0.467 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All Y +M3B3 ╞═╣
║ Best                                         83.457 ║
║ Worst                                       -30.201 ║
║ Total                                        -0.001 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All Y +MzB3 ╞═╗
║ Best                                         53.533 ║
║ Worst                                       -52.903 ║
║ Total                                        -3.119 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All Y +MzB3 ╞═╣
║ Best                                         80.840 ║
║ Worst                                       -27.689 ║
║ Total                                         1.231 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All Y +MzB3 ╞═╣
║ Best                                         77.700 ║
║ Worst                                       -18.990 ║
║ Total                                         0.850 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All Y +MzB3 ╞═╣
║ Best                                         80.487 ║
║ Worst                                       -34.474 ║
║ Total                                        -0.001 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life Y +M3B3 ╞═╗
║ Best                                         10.000 ║
║ Worst                                       -62.980 ║
║ Total                                       -30.370 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life Y +M3B3 ╞═╣
║ Best                                         31.129 ║
║ Worst                                       -24.415 ║
║ Total                                        12.343 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life Y +M3B3 ╞═╣
║ Best                                         14.909 ║
║ Worst                                       -49.562 ║
║ Total                                        -7.036 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life Y +M3B3 ╞═╣
║ Best                                          8.198 ║
║ Worst                                        -6.198 ║
║ Total                                         2.058 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life Y +MzB3 ╞═╗
║ Best                                         10.000 ║
║ Worst                                        -7.097 ║
║ Total                                        -3.327 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life Y +MzB3 ╞═╣
║ Best                                         28.350 ║
║ Worst                                        -2.816 ║
║ Total                                        14.934 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life Y +MzB3 ╞═╣
║ Best                                         14.432 ║
║ Worst                                        -2.513 ║
║ Total                                         2.758 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life Y +MzB3 ╞═╣
║ Best                                          6.333 ║
║ Worst                                        -4.902 ║
║ Total                                         1.729 ║
╚═════════════════════════════════════════════════════╝

@github-actions
Copy link

github-actions bot commented Feb 7, 2025

Results for: eravm ir-llvm zk_evm
╔═╡ Size (-%) ╞════════════╡ EVMInterpreter Y +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╠═╡ Cycles (-%) ╞══════════╡ EVMInterpreter Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞════════════╡ EVMInterpreter Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞════════════╡ EVMInterpreter Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs/gas ╞═════════════╡ EVMInterpreter Y +M3B3 ╞═╣
║ ADD                                          28.083 ║
║ MUL                                          16.850 ║
║ SUB                                          28.083 ║
║ DIV                                          19.250 ║
║ SDIV                                         36.050 ║
║ MOD                                          19.250 ║
║ SMOD                                         33.650 ║
║ ADDMOD                                       18.156 ║
║ MULMOD                                       16.656 ║
║ EXP                                           6.904 ║
║ SIGNEXTEND                                   19.250 ║
║ LT                                           32.083 ║
║ GT                                           32.083 ║
║ SLT                                          54.083 ║
║ SGT                                          54.083 ║
║ EQ                                           32.083 ║
║ ISZERO                                       27.750 ║
║ AND                                          28.083 ║
║ OR                                           28.083 ║
║ XOR                                          28.083 ║
║ NOT                                          23.750 ║
║ BYTE                                         38.083 ║
║ SHL                                          34.083 ║
║ SHR                                          34.083 ║
║ SAR                                          52.083 ║
║ SGT                                          54.083 ║
║ SHA3                                         25.073 ║
║ ADDRESS                                      41.812 ║
║ BALANCE                                      20.823 ║
║ ORIGIN                                     1351.625 ║
║ CALLER                                       41.812 ║
║ CALLVALUE                                    41.812 ║
║ CALLDATALOAD                                 26.083 ║
║ CALLDATASIZE                                 42.125 ║
║ CALLDATACOPY                                 49.492 ║
║ CODESIZE                                     45.625 ║
║ CODECOPY                                     61.472 ║
║ GASPRICE                                   1348.438 ║
║ EXTCODESIZE                                   3.605 ║
║ EXTCODECOPY                                   3.693 ║
║ RETURNDATASIZE                               43.500 ║
║ RETURNDATACOPY                               43.889 ║
║ EXTCODEHASH                                   4.641 ║
║ BLOCKHASH                                   238.819 ║
║ COINBASE                                   1348.625 ║
║ TIMESTAMP                                  1342.625 ║
║ NUMBER                                     1342.625 ║
║ PREVRANDAO                                 1342.625 ║
║ GASLIMIT                                   1348.625 ║
║ CHAINID                                    1336.625 ║
║ SELFBALANCE                                 639.250 ║
║ BASEFEE                                    1342.625 ║
║ POP                                          39.125 ║
║ MLOAD                                        43.667 ║
║ MSTORE                                       55.248 ║
║ MSTORE8                                      64.716 ║
║ SLOAD                                        18.930 ║
║ SSTORE                                        4.452 ║
║ JUMP                                         15.667 ║
║ JUMPI                                        15.636 ║
║ PC                                           42.312 ║
║ MSIZE                                        48.812 ║
║ GAS                                          42.312 ║
║ JUMPDEST                                     59.625 ║
║ PUSH0                                        42.312 ║
║ PUSH1                                        37.958 ║
║ PUSH2                                        43.375 ║
║ PUSH4                                        46.208 ║
║ PUSH5                                        47.625 ║
║ PUSH6                                        49.042 ║
║ PUSH7                                        50.458 ║
║ PUSH8                                        51.875 ║
║ PUSH9                                        53.292 ║
║ PUSH10                                       54.708 ║
║ PUSH11                                       56.125 ║
║ PUSH12                                       57.542 ║
║ PUSH13                                       58.958 ║
║ PUSH14                                       60.375 ║
║ PUSH15                                       61.792 ║
║ PUSH16                                       63.208 ║
║ PUSH17                                       64.625 ║
║ PUSH18                                       66.042 ║
║ PUSH19                                       67.458 ║
║ PUSH20                                       68.875 ║
║ PUSH21                                       70.292 ║
║ PUSH22                                       71.708 ║
║ PUSH23                                       73.125 ║
║ PUSH24                                       74.542 ║
║ PUSH25                                       75.958 ║
║ PUSH26                                       77.375 ║
║ PUSH27                                       78.792 ║
║ PUSH28                                       80.208 ║
║ PUSH29                                       81.625 ║
║ PUSH30                                       83.042 ║
║ PUSH31                                       84.458 ║
║ PUSH32                                       85.875 ║
║ DUP1                                         26.083 ║
║ DUP2                                         32.417 ║
║ DUP3                                         32.417 ║
║ DUP4                                         32.417 ║
║ DUP5                                         32.417 ║
║ DUP6                                         32.417 ║
║ DUP7                                         32.417 ║
║ DUP8                                         32.417 ║
║ DUP9                                         32.417 ║
║ DUP10                                        32.417 ║
║ DUP11                                        32.417 ║
║ DUP12                                        32.417 ║
║ DUP13                                        32.417 ║
║ DUP14                                        32.417 ║
║ DUP15                                        32.417 ║
║ DUP16                                        32.417 ║
║ SWAP1                                        32.417 ║
║ SWAP2                                        32.417 ║
║ SWAP3                                        32.417 ║
║ SWAP4                                        32.417 ║
║ SWAP5                                        32.417 ║
║ SWAP6                                        32.417 ║
║ SWAP7                                        32.417 ║
║ SWAP8                                        32.417 ║
║ SWAP9                                        32.417 ║
║ SWAP10                                       32.417 ║
║ SWAP11                                       32.417 ║
║ SWAP12                                       32.417 ║
║ SWAP13                                       32.417 ║
║ SWAP14                                       32.417 ║
║ SWAP15                                       32.417 ║
║ SWAP16                                       32.417 ║
║ CALL                                         33.875 ║
║ STATICCALL                                   33.852 ║
║ DELEGATECALL                                 32.920 ║
║ CREATE                                        3.703 ║
║ CREATE2                                       4.994 ║
║ RETURN                                       33.645 ║
║ REVERT                                       33.742 ║
╠═╡ Ergs/gas (-%) ╞════════╡ EVMInterpreter Y +M3B3 ╞═╣
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════════╡ EVMInterpreter Y +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╠═╡ Cycles (-%) ╞══════════╡ EVMInterpreter Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞════════════╡ EVMInterpreter Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞════════════╡ EVMInterpreter Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All E +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All E +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All E +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All E +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All E +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All E +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All E +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All E +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All V +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All V +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All V +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All V +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All V +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All V +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All V +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All V +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All Y +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═══════════════════════╡ All Y +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═════════════════════╡ All Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═══════════════════════╡ All Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═══════════════════════╡ All Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════╡ Precompiles NoCodegen M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞══════╡ Precompiles NoCodegen M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞════════╡ Precompiles NoCodegen M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞════════╡ Precompiles NoCodegen M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞════════╡ Precompiles NoCodegen MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞══════╡ Precompiles NoCodegen MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞════════╡ Precompiles NoCodegen MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞════════╡ Precompiles NoCodegen MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life E +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life E +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life E +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life E +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life E +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life E +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life E +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life E +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life V +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life V +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life V +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life V +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life V +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life V +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life V +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life V +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life Y +M3B3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life Y +M3B3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

╔═╡ Size (-%) ╞═════════════════╡ Real life Y +MzB3 ╞═╗
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Cycles (-%) ╞═══════════════╡ Real life Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠═╡ Ergs (-%) ╞═════════════════╡ Real life Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                         0.000 ║
╠══╡ Gas (-%) ╞═════════════════╡ Real life Y +MzB3 ╞═╣
║ Best                                          0.000 ║
║ Worst                                         0.000 ║
║ Total                                           NaN ║
╚═════════════════════════════════════════════════════╝

…erator

And remove EVMStackDebug.h and EVMStackDebug.cpp.

This patch is a joint work by:
Pavel Kopyl <pavelkopyl@gmail.com>
Vladimir Radosavljevic <vr@matterlabs.dev>

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
This patch is a joint work by:
Pavel Kopyl <pavelkopyl@gmail.com>
Vladimir Radosavljevic <vr@matterlabs.dev>

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
@github-actions
Copy link

github-actions bot commented Feb 13, 2025

Target Mode Toolchain Environment Link
eravm E+M3B3_0.8 ir-llvm zk_evm Results
eravm E+MzB3_0.8 ir-llvm zk_evm Results
eravm Y+M3B3 ir-llvm zk_evm Results
eravm Y+MzB3 ir-llvm zk_evm Results
evm E+M3B3_0.8 ir-llvm EVMInterpreter Results
evm E+M3B3_0.8 ir-llvm REVM Results
evm E+MzB3_0.8 ir-llvm EVMInterpreter Results
evm E+MzB3_0.8 ir-llvm REVM Results
evm Y+M3B3 ir-llvm EVMInterpreter Results
evm Y+M3B3 ir-llvm REVM Results
evm Y+MzB3 ir-llvm EVMInterpreter Results
evm Y+MzB3 ir-llvm REVM Results
evm E+_0.8 solc EVMInterpreter Results
evm E+_0.8 solc REVM Results
evm Y+ solc EVMInterpreter Results
evm Y+ solc REVM Results

Add stack depth limit to subtarget, and get
it from there. This will allow to extend this
for EOF ISA in a future.

This patch is a joint work by:
Pavel Kopyl <pavelkopyl@gmail.com>
Vladimir Radosavljevic <vr@matterlabs.dev>

Signed-off-by: Vladimir Radosavljevic <vr@matterlabs.dev>
This also includes refactoring of
'Stack too deep' error output.

This patch is a joint work by:
Pavel Kopyl <pavelkopyl@gmail.com>
Vladimir Radosavljevic <vr@matterlabs.dev>
@akiramenai akiramenai closed this Mar 13, 2025
@akiramenai akiramenai deleted the ef-stackification branch March 26, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants