Merge pull request #10286 from ethereum/yul-evmasm-optim

Optimise libevmasm in yul
This commit is contained in:
chriseth 2021-07-05 14:24:27 +02:00 committed by GitHub
commit 19b217dcf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
146 changed files with 266 additions and 283 deletions

View File

@ -4,6 +4,7 @@ Language Features:
Compiler Features:
* AssemblyStack: Also run opcode-based optimizer when compiling Yul code.
* Yul EVM Code Transform: Do not reuse stack slots that immediately become unreachable.
* Yul EVM Code Transform: Also pop unused argument slots for functions without return variables (under the same restrictions as for functions with return variables).
* Yul Optimizer: Move function arguments and return variables to memory with the experimental Stack Limit Evader (which is not enabled by default).

View File

@ -36,8 +36,6 @@
#include <libyul/ObjectParser.h>
#include <libyul/optimiser/Suite.h>
#include <libsolidity/interface/OptimiserSettings.h>
#include <libevmasm/Assembly.h>
#include <liblangutil/Scanner.h>
#include <optional>
@ -65,6 +63,28 @@ Dialect const& languageToDialect(AssemblyStack::Language _language, EVMVersion _
return Dialect::yulDeprecated();
}
// Duplicated from libsolidity/codegen/CompilerContext.cpp
// TODO: refactor and remove duplication
evmasm::Assembly::OptimiserSettings translateOptimiserSettings(
frontend::OptimiserSettings const& _settings,
langutil::EVMVersion _evmVersion
)
{
// Constructing it this way so that we notice changes in the fields.
evmasm::Assembly::OptimiserSettings asmSettings{false, false, false, false, false, false, false, _evmVersion, 0};
asmSettings.isCreation = true;
asmSettings.runInliner = _settings.runInliner;
asmSettings.runJumpdestRemover = _settings.runJumpdestRemover;
asmSettings.runPeephole = _settings.runPeephole;
asmSettings.runDeduplicate = _settings.runDeduplicate;
asmSettings.runCSE = _settings.runCSE;
asmSettings.runConstantOptimiser = _settings.runConstantOptimiser;
asmSettings.expectedExecutionsPerDeployment = _settings.expectedExecutionsPerDeployment;
asmSettings.evmVersion = _evmVersion;
return asmSettings;
}
}
@ -261,6 +281,8 @@ AssemblyStack::assembleEVMWithDeployed(optional<string_view> _deployName) const
EthAssemblyAdapter adapter(assembly);
compileEVM(adapter, m_optimiserSettings.optimizeStackAllocation);
assembly.optimise(translateOptimiserSettings(m_optimiserSettings, m_evmVersion));
optional<size_t> subIndex;
// Pick matching assembly if name was given

View File

@ -23,7 +23,7 @@ object "MyContract" {
Binary representation:
33600055600b806012600039806000f350fe60005460005260206000f3
33600055600b806011600039806000f3fe60005460005260206000f3
Text representation:
/* "object_compiler/input.yul":128:136 */
@ -46,7 +46,6 @@ Text representation:
0x00
/* "object_compiler/input.yul":265:295 */
return
pop
stop
sub_0: assembly {

View File

@ -5,7 +5,7 @@
/* \"A\":38:39 */
0x00
/* \"A\":34:35 */
0x00
dup1
/* \"A\":31:32 */
dup3
/* \"A\":27:36 */

View File

@ -2,7 +2,7 @@
/* \"A\":80:81 */
0x00
/* \"A\":76:77 */
0x00
dup1
/* \"A\":73:74 */
dup3
/* \"A\":69:78 */

View File

@ -2,7 +2,7 @@
/* \"A\":80:81 */
0x00
/* \"A\":76:77 */
0x00
dup1
/* \"A\":73:74 */
dup3
/* \"A\":69:78 */
@ -18,7 +18,7 @@ sub_0: assembly {
/* \"A\":147:148 */
0x00
/* \"A\":144:145 */
0x00
dup1
/* \"A\":137:149 */
revert
}

View File

@ -1,18 +1,10 @@
{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":17:18 */
0x00
/* \"A\":11:19 */
dup1
mload
/* \"A\":38:39 */
0x00
/* \"A\":34:35 */
0x00
/* \"A\":31:32 */
dup3
/* \"A\":27:36 */
add
/* \"A\":20:40 */
sstore
pop
","bytecode":{"functionDebugData":{},"generatedSources":[],"linkReferences":{},"object":"<BYTECODE REMOVED>","opcodes":"<OPCODES REMOVED>","sourceMap":"<SOURCEMAP REMOVED>"}},"ir":"object \"object\" {
code {
let x := mload(0)

View File

@ -1,6 +1,6 @@
{"contracts":{"A":{"object":{"evm":{"assembly":" /* \"A\":17:18 */
0x00
0x00
dup1
/* \"A\":11:19 */
mload
/* \"A\":20:40 */

View File

@ -25,7 +25,7 @@ object "C_6" {
Binary representation:
60806040523415600f5760006000fd5b6015601d60003960156000f3fe6080604052600436101550361560005560006000fd
60806040523415600e57600080fd5b600e601c600039600e6000f3fe60806040523615600055600080fd
Text representation:
/* "strict_asm_optimizer_steps/input.yul":45:48 */
@ -43,7 +43,7 @@ Text representation:
/* "strict_asm_optimizer_steps/input.yul":85:86 */
0x00
/* "strict_asm_optimizer_steps/input.yul":82:83 */
0x00
dup1
/* "strict_asm_optimizer_steps/input.yul":75:87 */
revert
/* "strict_asm_optimizer_steps/input.yul":58:60 */
@ -70,16 +70,6 @@ sub_0: assembly {
0x40
/* "strict_asm_optimizer_steps/input.yul":287:302 */
mstore
/* "strict_asm_optimizer_steps/input.yul":348:349 */
0x04
/* "strict_asm_optimizer_steps/input.yul":332:346 */
calldatasize
/* "strict_asm_optimizer_steps/input.yul":329:350 */
lt
/* "strict_asm_optimizer_steps/input.yul":322:351 */
iszero
/* "strict_asm_optimizer_steps/input.yul":319:321 */
pop
/* "strict_asm_optimizer_steps/input.yul":533:547 */
calldatasize
/* "strict_asm_optimizer_steps/input.yul":526:548 */
@ -91,7 +81,7 @@ sub_0: assembly {
/* "strict_asm_optimizer_steps/input.yul":576:577 */
0x00
/* "strict_asm_optimizer_steps/input.yul":573:574 */
0x00
dup1
/* "strict_asm_optimizer_steps/input.yul":566:578 */
revert
}

View File

@ -17,13 +17,13 @@ object "object" {
Binary representation:
600260028103808261626382815564656678797a010203040506070900010203040506070900010203040506070900010201020304050607090001020304050607090001020304050607090001026009905050505050
6002808103808261626382815564656678797a010203040506070900010203040506070900010203040506070900010201020304050607090001020304050607090001020304050607090001026009905050505050
Text representation:
/* "yul_verbatim/input.yul":15:16 */
0x02
/* "yul_verbatim/input.yul":37:38 */
0x02
dup1
/* "yul_verbatim/input.yul":34:35 */
dup2
/* "yul_verbatim/input.yul":30:39 */

View File

@ -24,6 +24,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0x20, 0x8, 0x40, 0x3, 0x9, 0xa, 0xb
// gas irOptimized: 203921
// gas irOptimized: 203556
// gas legacy: 206126
// gas legacyOptimized: 203105

View File

@ -60,10 +60,10 @@ contract C {
// compileViaYul: also
// ----
// test_bytes() ->
// gas irOptimized: 465417
// gas irOptimized: 394829
// gas legacy: 423563
// gas legacyOptimized: 331391
// test_uint256() ->
// gas irOptimized: 661059
// gas irOptimized: 553331
// gas legacy: 591392
// gas legacyOptimized: 456137

View File

@ -26,6 +26,6 @@ contract C {
// ----
// library: L
// f() -> 8, 7, 1, 2, 7, 12
// gas irOptimized: 168199
// gas irOptimized: 167615
// gas legacy: 169475
// gas legacyOptimized: 167397

View File

@ -61,10 +61,10 @@ contract C {
// compileViaYul: also
// ----
// test_bytes() ->
// gas irOptimized: 465417
// gas irOptimized: 394829
// gas legacy: 423563
// gas legacyOptimized: 331391
// test_uint256() ->
// gas irOptimized: 661059
// gas irOptimized: 553331
// gas legacy: 591392
// gas legacyOptimized: 456137

View File

@ -53,6 +53,6 @@ contract C {
// f2() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
// f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
// f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3
// gas irOptimized: 113683
// gas irOptimized: 113296
// gas legacy: 114728
// gas legacyOptimized: 112606

View File

@ -32,6 +32,6 @@ contract C is B {
// compileViaYul: also
// ----
// test() -> 77
// gas irOptimized: 132435
// gas irOptimized: 120952
// gas legacy: 155249
// gas legacyOptimized: 111743

View File

@ -40,5 +40,5 @@ contract C is B {
// compileViaYul: also
// ----
// test() -> 5, 10
// gas irOptimized: 91524
// gas irOptimized: 88225
// gas legacy: 99137

View File

@ -21,6 +21,6 @@ contract C {
// f(uint256[][1]): 32, 32, 0 -> true
// f(uint256[][1]): 32, 32, 1, 42 -> true
// f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true
// gas irOptimized: 224675
// gas irOptimized: 177719
// gas legacy: 141900
// gas legacyOptimized: 121788

View File

@ -19,10 +19,10 @@ contract C {
// compileViaYul: also
// ----
// h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324
// gas irOptimized: 181410
// gas irOptimized: 181123
// gas legacy: 184929
// gas legacyOptimized: 181504
// i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224
// gas irOptimized: 112981
// gas irOptimized: 112627
// gas legacy: 115468
// gas legacyOptimized: 112988

View File

@ -11,6 +11,6 @@ contract C {
// compileViaYul: also
// ----
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
// gas irOptimized: 136231
// gas irOptimized: 135996
// gas legacy: 137190
// gas legacyOptimized: 136082

View File

@ -14,7 +14,7 @@ contract Test {
// compileViaYul: also
// ----
// set(uint24[3][]): 0x20, 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12 -> 0x06
// gas irOptimized: 191293
// gas irOptimized: 189567
// gas legacy: 211485
// gas legacyOptimized: 206394
// data(uint256,uint256): 0x02, 0x02 -> 0x09

View File

@ -47,7 +47,7 @@ contract c {
// gas legacyOptimized: 58606
// storageEmpty -> 0
// test_long() -> 67
// gas irOptimized: 91520
// gas irOptimized: 90759
// gas legacy: 103590
// gas legacyOptimized: 101044
// storageEmpty -> 0

View File

@ -19,6 +19,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0
// gas irOptimized: 171767
// gas irOptimized: 165224
// gas legacy: 189715
// gas legacyOptimized: 184472

View File

@ -15,7 +15,7 @@ contract c {
// ----
// getLength() -> 0
// set(): 1, 2 -> true
// gas irOptimized: 110570
// gas irOptimized: 110439
// gas legacy: 110726
// gas legacyOptimized: 110567
// getLength() -> 68

View File

@ -22,7 +22,7 @@ contract c {
// compileViaYul: also
// ----
// store(uint256[9],uint8[3][]): 21, 22, 23, 24, 25, 26, 27, 28, 29, 0x140, 4, 1, 2, 3, 11, 12, 13, 21, 22, 23, 31, 32, 33 -> 32
// gas irOptimized: 651816
// gas irOptimized: 650971
// gas legacy: 694515
// gas legacyOptimized: 694013
// retrieve() -> 9, 28, 9, 28, 4, 3, 32

View File

@ -23,6 +23,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> true
// gas irOptimized: 92958
// gas irOptimized: 92843
// gas legacy: 93035
// gas legacyOptimized: 92257

View File

@ -48,6 +48,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> true
// gas irOptimized: 154441
// gas irOptimized: 153927
// gas legacy: 155961
// gas legacyOptimized: 153588

View File

@ -15,6 +15,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0
// gas irOptimized: 135505
// gas irOptimized: 135145
// gas legacy: 135313
// gas legacyOptimized: 134548

View File

@ -42,11 +42,11 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0
// gas irOptimized: 92966
// gas irOptimized: 92855
// gas legacy: 93006
// gas legacyOptimized: 92261
// g() -> 0
// h() -> 0
// gas irOptimized: 93012
// gas irOptimized: 92922
// gas legacy: 93028
// gas legacyOptimized: 92303

View File

@ -21,6 +21,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x05000000000000000000000000000000000000000000000000
// gas irOptimized: 214644
// gas irOptimized: 212669
// gas legacy: 221883
// gas legacyOptimized: 220734

View File

@ -37,12 +37,12 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x02000202
// gas irOptimized: 4690992
// gas irOptimized: 4660920
// gas legacy: 4578341
// gas legacyOptimized: 4548354
// storageEmpty -> 1
// clear() -> 0, 0
// gas irOptimized: 4516821
// gas irOptimized: 4491908
// gas legacy: 4410769
// gas legacyOptimized: 4382531
// storageEmpty -> 1

View File

@ -15,6 +15,6 @@ contract c {
// compileViaYul: also
// ----
// test(uint256[2][]): 32, 3, 7, 8, 9, 10, 11, 12 -> 10
// gas irOptimized: 691977
// gas irOptimized: 690506
// gas legacy: 686268
// gas legacyOptimized: 685688

View File

@ -19,6 +19,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 5, 4
// gas irOptimized: 226467
// gas irOptimized: 226130
// gas legacy: 233801
// gas legacyOptimized: 232816

View File

@ -24,6 +24,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 3, 4
// gas irOptimized: 191858
// gas irOptimized: 190944
// gas legacy: 195353
// gas legacyOptimized: 192441

View File

@ -17,7 +17,7 @@ contract c {
// ----
// setData1(uint256,uint256,uint256): 10, 5, 4 ->
// copyStorageStorage() ->
// gas irOptimized: 111563
// gas irOptimized: 111487
// gas legacy: 109278
// gas legacyOptimized: 109268
// getData2(uint256): 5 -> 10, 4

View File

@ -20,6 +20,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 5, 4
// gas irOptimized: 272786
// gas irOptimized: 272806
// gas legacy: 270834
// gas legacyOptimized: 269960

View File

@ -14,6 +14,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 9, 4
// gas irOptimized: 123375
// gas irOptimized: 123172
// gas legacy: 123579
// gas legacyOptimized: 123208

View File

@ -18,6 +18,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 8, 0
// gas irOptimized: 236656
// gas irOptimized: 236016
// gas legacy: 234695
// gas legacyOptimized: 234103

View File

@ -19,7 +19,7 @@ contract c {
// compileViaYul: also
// ----
// test() -> 4, 5
// gas irOptimized: 240552
// gas irOptimized: 239134
// gas legacy: 238736
// gas legacyOptimized: 237159
// storageEmpty -> 1

View File

@ -17,6 +17,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0x20, 2, 0x40, 0xa0, 2, 0, 1, 2, 2, 3
// gas irOptimized: 161991
// gas irOptimized: 161746
// gas legacy: 162278
// gas legacyOptimized: 159955

View File

@ -20,6 +20,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0xffffffff, 0x0000000000000000000000000a00090008000700060005000400030002000100, 0x0000000000000000000000000000000000000000000000000000000000000000
// gas irOptimized: 140618
// gas irOptimized: 132180
// gas legacy: 186406
// gas legacyOptimized: 166126

View File

@ -22,6 +22,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x04000000000000000000000000000000000000000000000000, 0x0, 0x0
// gas irOptimized: 95528
// gas irOptimized: 93855
// gas legacy: 97451
// gas legacyOptimized: 94200

View File

@ -22,6 +22,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x0
// gas irOptimized: 296092
// gas irOptimized: 294958
// gas legacy: 303653
// gas legacyOptimized: 301999

View File

@ -22,6 +22,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x01000000000000000000000000000000000000000000000000, 0x02000000000000000000000000000000000000000000000000, 0x03000000000000000000000000000000000000000000000000, 0x04000000000000000000000000000000000000000000000000, 0x00
// gas irOptimized: 274785
// gas irOptimized: 274022
// gas legacy: 276381
// gas legacyOptimized: 275453

View File

@ -38,10 +38,10 @@ contract c {
// compileViaYul: true
// ----
// test1(uint256[][]): 0x20, 2, 0x40, 0x40, 2, 23, 42 -> 2, 65
// gas irOptimized: 182348
// gas irOptimized: 181755
// test2(uint256[][2]): 0x20, 0x40, 0x40, 2, 23, 42 -> 2, 65
// gas irOptimized: 158638
// gas irOptimized: 158111
// test3(uint256[2][]): 0x20, 2, 23, 42, 23, 42 -> 2, 65
// gas irOptimized: 135778
// gas irOptimized: 135282
// test4(uint256[2][2]): 23, 42, 23, 42 -> 65
// gas irOptimized: 111695
// gas irOptimized: 111460

View File

@ -40,12 +40,12 @@ contract Test {
// compileViaYul: also
// ----
// test() -> 24
// gas irOptimized: 227891
// gas irOptimized: 227254
// gas legacy: 227133
// gas legacyOptimized: 226547
// test1() -> 3
// test2() -> 6
// test3() -> 24
// gas irOptimized: 134338
// gas irOptimized: 133742
// gas legacy: 134295
// gas legacyOptimized: 133383

View File

@ -17,4 +17,4 @@ contract C {
// compileViaYul: true
// ----
// f((uint128,uint64,uint128)[]): 0x20, 3, 0, 0, 12, 0, 11, 0, 10, 0, 0 -> 10, 11, 12
// gas irOptimized: 121461
// gas irOptimized: 121194

View File

@ -19,4 +19,4 @@ contract C {
// compileViaYul: true
// ----
// f() -> 10, 11, 12
// gas irOptimized: 120457
// gas irOptimized: 119201

View File

@ -23,4 +23,4 @@ contract C {
// compileViaYul: true
// ----
// f((uint256[])[]): 0x20, 3, 0x60, 0x60, 0x60, 0x20, 3, 1, 2, 3 -> 3, 1
// gas irOptimized: 332878
// gas irOptimized: 330384

View File

@ -26,4 +26,4 @@ contract C {
// compileViaYul: true
// ----
// f() -> 3, 3, 3, 1
// gas irOptimized: 185077
// gas irOptimized: 183411

View File

@ -15,6 +15,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 1, 2, 3
// gas irOptimized: 133671
// gas irOptimized: 132580
// gas legacy: 134619
// gas legacyOptimized: 131940

View File

@ -12,7 +12,7 @@ contract Test {
// compileViaYul: also
// ----
// set(uint24[]): 0x20, 18, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 -> 18
// gas irOptimized: 101659
// gas irOptimized: 100066
// gas legacy: 103815
// gas legacyOptimized: 101614
// data(uint256): 7 -> 8

View File

@ -7,11 +7,11 @@ contract c {
// compileViaYul: also
// ----
// set(uint256): 1, 2 -> true
// gas irOptimized: 110824
// gas irOptimized: 110678
// gas legacy: 111091
// gas legacyOptimized: 110736
// set(uint256): 2, 2, 3, 4, 5 -> true
// gas irOptimized: 177811
// gas irOptimized: 177635
// gas legacy: 178021
// gas legacyOptimized: 177666
// storageEmpty -> 0

View File

@ -19,25 +19,25 @@ contract c {
// ----
// f(uint256): 0 -> 0x20, 0x00
// f(uint256): 31 -> 0x20, 0x1f, 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00
// gas irOptimized: 135396
// gas irOptimized: 125470
// gas legacy: 124364
// gas legacyOptimized: 119898
// f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671
// gas irOptimized: 142291
// gas irOptimized: 134121
// gas legacy: 135431
// gas legacyOptimized: 130829
// f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000
// gas irOptimized: 149603
// gas irOptimized: 141217
// gas legacy: 142238
// gas legacyOptimized: 137518
// f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992
// gas irOptimized: 174873
// gas irOptimized: 158957
// gas legacy: 160728
// gas legacyOptimized: 152168
// f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000
// gas legacy: 59345
// gas legacyOptimized: 57279
// f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968
// gas irOptimized: 452115
// gas irOptimized: 419485
// gas legacy: 423017
// gas legacyOptimized: 406021

View File

@ -11,6 +11,6 @@ contract C {
// compileViaYul: also
// ----
// f(uint256[]): 0x20, 0x03, 0x1, 0x2, 0x3 -> 0x1
// gas irOptimized: 111384
// gas irOptimized: 111204
// gas legacy: 111565
// gas legacyOptimized: 111347

View File

@ -37,11 +37,11 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000
// gas irOptimized: 180274
// gas irOptimized: 179963
// gas legacy: 180694
// gas legacyOptimized: 180088
// g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000
// gas irOptimized: 107618
// gas irOptimized: 107332
// gas legacy: 107895
// gas legacyOptimized: 107254
// h() -> 0x40, 0x60, 0x00, 0x00

View File

@ -48,6 +48,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0xff
// gas irOptimized: 122009
// gas irOptimized: 121438
// gas legacy: 126745
// gas legacyOptimized: 123476

View File

@ -18,6 +18,6 @@ contract C {
// compileViaYul: also
// ----
// test() -> 7
// gas irOptimized: 127846
// gas irOptimized: 126212
// gas legacy: 205196
// gas legacyOptimized: 204987

View File

@ -9,7 +9,7 @@ contract c {
// compileViaYul: also
// ----
// set(): 1, 2, 3, 4, 5 -> true
// gas irOptimized: 177557
// gas irOptimized: 177396
// gas legacy: 177656
// gas legacyOptimized: 177496
// storageEmpty -> 0

View File

@ -20,6 +20,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 3
// gas irOptimized: 134208
// gas irOptimized: 131095
// gas legacy: 130307
// gas legacyOptimized: 129363

View File

@ -19,6 +19,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 1, 2, 3, 4, 5, 6, 7
// gas irOptimized: 209108
// gas irOptimized: 207030
// gas legacy: 212325
// gas legacyOptimized: 211486

View File

@ -13,6 +13,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0x20, 0x02, 0x40, 0x80, 3, 0x6162630000000000000000000000000000000000000000000000000000000000, 0x99, 44048183304486788312148433451363384677562265908331949128489393215789685032262, 32241931068525137014058842823026578386641954854143559838526554899205067598957, 49951309422467613961193228765530489307475214998374779756599339590522149884499, 0x54555658595a6162636465666768696a6b6c6d6e6f707172737475767778797a, 0x4142434445464748494a4b4c4d4e4f5051525354555658595a00000000000000
// gas irOptimized: 203063
// gas irOptimized: 202750
// gas legacy: 204459
// gas legacyOptimized: 203437

View File

@ -20,6 +20,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 1, 2, 3, 4, 5, 6, 7
// gas irOptimized: 209108
// gas irOptimized: 207030
// gas legacy: 212330
// gas legacyOptimized: 211491

View File

@ -26,6 +26,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 11, 0x0c, 1, 0x15, 22, 4
// gas irOptimized: 293695
// gas irOptimized: 291923
// gas legacy: 293516
// gas legacyOptimized: 290263

View File

@ -15,6 +15,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> 2, 3, 4
// gas irOptimized: 115383
// gas irOptimized: 114568
// gas legacy: 126449
// gas legacyOptimized: 120902

View File

@ -20,6 +20,6 @@ contract C {
// compileViaYul: also
// ----
// f() -> "A", 8, 4, "B"
// gas irOptimized: 150997
// gas irOptimized: 140716
// gas legacy: 121398
// gas legacyOptimized: 115494

View File

@ -18,6 +18,6 @@ contract c {
// compileViaYul: also
// ----
// test1() -> true
// gas irOptimized: 244579
// gas irOptimized: 230748
// gas legacy: 255577
// gas legacyOptimized: 248611

View File

@ -16,4 +16,4 @@ contract C {
// compileViaYul: also
// ----
// f() -> 0, 0, 0
// gas irOptimized: 91179
// gas irOptimized: 91245

View File

@ -16,7 +16,7 @@ contract c {
// ----
// storageEmpty -> 1
// fill() ->
// gas irOptimized: 520998
// gas irOptimized: 520360
// gas legacy: 521773
// gas legacyOptimized: 517048
// storageEmpty -> 0

View File

@ -44,7 +44,7 @@ contract c {
// ----
// getLengths() -> 0, 0
// setLengths(uint256,uint256): 48, 49 ->
// gas irOptimized: 108326
// gas irOptimized: 104851
// gas legacy: 108571
// gas legacyOptimized: 100417
// getLengths() -> 48, 49

View File

@ -18,7 +18,7 @@ contract c {
// ----
// storageEmpty -> 1
// fill() -> 8
// gas irOptimized: 124480
// gas irOptimized: 123113
// gas legacy: 121756
// gas legacyOptimized: 120687
// storageEmpty -> 0

View File

@ -13,7 +13,7 @@ contract c {
// ----
// storageEmpty -> 1
// fill() ->
// gas irOptimized: 465878
// gas irOptimized: 465690
// gas legacy: 471460
// gas legacyOptimized: 467520
// storageEmpty -> 0

View File

@ -21,6 +21,6 @@ contract B {
// compileViaYul: also
// ----
// f() -> 2, 3, 4, 5, 6, 1000, 1001, 1002, 1003, 1004
// gas irOptimized: 133483
// gas irOptimized: 121038
// gas legacy: 235167
// gas legacyOptimized: 133299

View File

@ -45,6 +45,6 @@ contract C {
// compileViaYul: also
// ----
// test() -> 5, 6, 7
// gas irOptimized: 337455
// gas irOptimized: 299965
// gas legacy: 463662
// gas legacyOptimized: 296513

View File

@ -25,7 +25,7 @@ contract c {
// compileViaYul: also
// ----
// test() -> 1, 2, 3
// gas irOptimized: 2280897
// gas irOptimized: 2272395
// gas legacy: 2273722
// gas legacyOptimized: 2262396
// storageEmpty -> 1

View File

@ -20,7 +20,7 @@ contract c {
// compileViaYul: also
// ----
// test() -> 38, 28, 18
// gas irOptimized: 195867
// gas irOptimized: 192323
// gas legacy: 189780
// gas legacyOptimized: 178870
// storageEmpty -> 1

View File

@ -20,7 +20,7 @@ contract c {
// compileViaYul: also
// ----
// test() -> 20, 10
// gas irOptimized: 163721
// gas irOptimized: 161105
// gas legacy: 159459
// gas legacyOptimized: 153281
// storageEmpty -> 1

View File

@ -12,6 +12,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x20, 29, 0x0303030303030303030303030303030303030303030303030303030303000000
// gas irOptimized: 112526
// gas irOptimized: 111157
// gas legacy: 127309
// gas legacyOptimized: 124136

View File

@ -18,7 +18,7 @@ contract c {
// compileViaYul: also
// ----
// test() -> true
// gas irOptimized: 219418
// gas irOptimized: 205254
// gas legacy: 229864
// gas legacyOptimized: 210964
// storageEmpty -> 1

View File

@ -17,7 +17,7 @@ contract c {
// compileViaYul: also
// ----
// test() ->
// gas irOptimized: 150914
// gas irOptimized: 146450
// gas legacy: 165363
// gas legacyOptimized: 159446
// storageEmpty -> 1

View File

@ -12,6 +12,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000
// gas irOptimized: 110514
// gas irOptimized: 109314
// gas legacy: 126187
// gas legacyOptimized: 123261

View File

@ -18,6 +18,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 5, 4, 3, 3
// gas irOptimized: 111269
// gas irOptimized: 111289
// gas legacy: 111838
// gas legacyOptimized: 111128

View File

@ -14,6 +14,6 @@ contract C {
// compileViaYul: also
// ----
// f(uint120[]): 0x20, 3, 1, 2, 3 -> 1
// gas irOptimized: 113684
// gas irOptimized: 113393
// gas legacy: 113686
// gas legacyOptimized: 113499

View File

@ -16,6 +16,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 1, 2, 3, 4
// gas irOptimized: 93083
// gas irOptimized: 93200
// gas legacy: 92798
// gas legacyOptimized: 92062

View File

@ -22,6 +22,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 2, 3, 4, 5
// gas irOptimized: 138070
// gas irOptimized: 137059
// gas legacy: 147484
// gas legacyOptimized: 146456

View File

@ -18,6 +18,6 @@ contract c {
// compileViaYul: also
// ----
// test((uint16,uint16,uint16[3],uint16[])): 0x20, 2, 3, 0, 0, 4, 0xC0, 4, 0, 0, 5, 0, 0 -> 2, 3, 4, 5
// gas irOptimized: 139798
// gas irOptimized: 139100
// gas legacy: 144322
// gas legacyOptimized: 139171

View File

@ -17,6 +17,6 @@ contract c {
// compileViaYul: also
// ----
// test() -> 0
// gas irOptimized: 195787
// gas irOptimized: 185231
// gas legacy: 218028
// gas legacyOptimized: 205124

View File

@ -15,6 +15,6 @@ contract C {
// compileViaYul: also
// ----
// f() ->
// gas irOptimized: 180067
// gas irOptimized: 179867
// gas legacy: 180620
// gas legacyOptimized: 180403

View File

@ -29,14 +29,14 @@ contract C {
// ----
// l() -> 0
// f(uint256,uint256): 42, 64 ->
// gas irOptimized: 116221
// gas irOptimized: 114151
// gas legacy: 108234
// gas legacyOptimized: 102245
// l() -> 1
// ll(uint256): 0 -> 43
// a(uint256,uint256): 0, 42 -> 64
// f(uint256,uint256): 84, 128 ->
// gas irOptimized: 123537
// gas irOptimized: 119535
// gas legacy: 107780
// gas legacyOptimized: 96331
// l() -> 2

View File

@ -23,7 +23,7 @@ contract C {
// ----
// l() -> 0
// g(uint256): 70 ->
// gas irOptimized: 194029
// gas irOptimized: 191389
// gas legacy: 184991
// gas legacyOptimized: 180608
// l() -> 70

View File

@ -26,6 +26,6 @@ contract Main {
// compileViaYul: also
// ----
// f(uint256): 0x34 -> 0x46bddb1178e94d7f2892ff5f366840eb658911794f2c3a44c450aa2c505186c1
// gas irOptimized: 115243
// gas irOptimized: 113954
// gas legacy: 126852
// gas legacyOptimized: 114079

View File

@ -26,6 +26,6 @@ contract Creator {
// compileViaYul: also
// ----
// f(uint256,address[]): 7, 0x40, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 -> 7, 8
// gas irOptimized: 486618
// gas irOptimized: 459815
// gas legacy: 592626
// gas legacyOptimized: 450224

View File

@ -26,6 +26,6 @@ contract Creator {
// compileViaYul: also
// ----
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
// gas irOptimized: 336157
// gas irOptimized: 312176
// gas legacy: 429173
// gas legacyOptimized: 298384

View File

@ -19,6 +19,6 @@ contract C {
// compileViaYul: also
// ----
// f(), 2000 ether -> true
// gas irOptimized: 123743
// gas irOptimized: 123090
// gas legacy: 123226
// gas legacyOptimized: 123092

View File

@ -15,6 +15,6 @@ contract C {
// ----
// createEvent(uint256): 42 ->
// ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c
// gas irOptimized: 115211
// gas irOptimized: 114816
// gas legacy: 116393
// gas legacyOptimized: 114415

View File

@ -16,6 +16,6 @@ contract C {
// ----
// createEvent(uint256): 42 ->
// ~ emit E(uint256[]): 0x20, 0x03, 0x2a, 0x2b, 0x2c
// gas irOptimized: 115211
// gas irOptimized: 114816
// gas legacy: 116393
// gas legacyOptimized: 114415

View File

@ -17,6 +17,6 @@ contract C {
// ----
// createEvent(uint256): 42 ->
// ~ emit E(uint256[][]): 0x20, 0x02, 0x40, 0xa0, 0x02, 0x2a, 0x2b, 0x02, 0x2c, 0x2d
// gas irOptimized: 185905
// gas irOptimized: 185564
// gas legacy: 187621
// gas legacyOptimized: 184551

View File

@ -19,6 +19,6 @@ contract C {
// ----
// deposit() ->
// ~ emit E(string,uint256[4]): #0xa7fb06bb999a5eb9aff9e0779953f4e1e4ce58044936c2f51c7fb879b85c08bd, #0xe755d8cc1a8cde16a2a31160dcd8017ac32d7e2f13215b29a23cdae40a78aa81
// gas irOptimized: 368478
// gas irOptimized: 353515
// gas legacy: 390742
// gas legacyOptimized: 376774

View File

@ -76,12 +76,12 @@ contract FixedFeeRegistrar is Registrar {
// compileViaYul: also
// ----
// constructor()
// gas irOptimized: 544916
// gas irOptimized: 433748
// gas legacy: 936897
// gas legacyOptimized: 491019
// reserve(string), 69 ether: 0x20, 3, "abc" ->
// ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45
// gas irOptimized: 46127
// gas irOptimized: 46070
// gas legacy: 46842
// gas legacyOptimized: 46091
// owner(string): 0x20, 3, "abc" -> 0x1212121212121212121212121212120000000012

View File

@ -178,35 +178,35 @@ contract DepositContract is IDepositContract, ERC165 {
// compileViaYul: also
// ----
// constructor()
// gas irOptimized: 1805935
// gas irOptimized: 1657475
// gas legacy: 2580394
// gas legacyOptimized: 1803757
// gas legacyOptimized: 1775403
// supportsInterface(bytes4): 0x0 -> 0
// supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 #
// supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id #
// supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id #
// get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e
// gas irOptimized: 127482
// gas irOptimized: 122599
// gas legacy: 150465
// gas legacyOptimized: 122798
// get_deposit_count() -> 0x20, 8, 0 # TODO: check balance and logs after each deposit #
// deposit(bytes,bytes,bytes,bytes32), 32 ether: 0 -> FAILURE # Empty input #
// get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e
// gas irOptimized: 127482
// gas irOptimized: 122599
// gas legacy: 150465
// gas legacyOptimized: 122798
// get_deposit_count() -> 0x20, 8, 0
// deposit(bytes,bytes,bytes,bytes32), 1 ether: 0x80, 0xe0, 0x120, 0xaa4a8d0b7d9077248630f1a4701ae9764e42271d7f22b7838778411857fd349e, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0x00f50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8 -> # txhash: 0x7085c586686d666e8bb6e9477a0f0b09565b2060a11f1c4209d3a52295033832 #
// ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00
// get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438
// gas irOptimized: 127486
// gas irOptimized: 122606
// gas legacy: 150475
// gas legacyOptimized: 122811
// get_deposit_count() -> 0x20, 8, 0x0100000000000000000000000000000000000000000000000000000000000000
// deposit(bytes,bytes,bytes,bytes32), 32 ether: 0x80, 0xe0, 0x120, 0xdbd986dc85ceb382708cf90a3500f500f0a393c5ece76963ac3ed72eccd2c301, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x00344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d -> # txhash: 0x404d8e109822ce448e68f45216c12cb051b784d068fbe98317ab8e50c58304ac #
// ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000
// get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee
// gas irOptimized: 127486
// gas irOptimized: 122606
// gas legacy: 150475
// gas legacyOptimized: 122811
// get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000

Some files were not shown because too many files have changed in this diff Show More