forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CommandLineParser: Handle --optimize-runs option in assembly mode
Fixes ethereum#11708.
- Loading branch information
Showing
12 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--yul --yul-dialect evm --optimize --ir-optimized --optimize-runs 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Warning: Yul is still experimental. Please use the output with care. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
object "RunsTest1" { | ||
code { | ||
// Deploy the contract | ||
datacopy(0, dataoffset("Runtime"), datasize("Runtime")) | ||
return(0, datasize("Runtime")) | ||
} | ||
object "Runtime" { | ||
code { | ||
let funcSel := shl(224, 0xabc12345) | ||
mstore(0, funcSel) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
======= yul_optimize_runs/input.yul (EVM) ======= | ||
|
||
Pretty printed source: | ||
object "RunsTest1" { | ||
code { | ||
{ | ||
let _1 := datasize("Runtime") | ||
datacopy(0, dataoffset("Runtime"), _1) | ||
return(0, _1) | ||
} | ||
} | ||
object "Runtime" { | ||
code { | ||
{ | ||
mstore(0, 0xabc1234500000000000000000000000000000000000000000000000000000000) | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
Binary representation: | ||
602480600d600039806000f3fe7fabc1234500000000000000000000000000000000000000000000000000000000600052 | ||
|
||
Text representation: | ||
/* "yul_optimize_runs/input.yul":106:125 */ | ||
dataSize(sub_0) | ||
dup1 | ||
/* "yul_optimize_runs/input.yul":83:104 */ | ||
dataOffset(sub_0) | ||
/* "yul_optimize_runs/input.yul":80:81 */ | ||
0x00 | ||
/* "yul_optimize_runs/input.yul":71:126 */ | ||
codecopy | ||
/* "yul_optimize_runs/input.yul":145:164 */ | ||
dup1 | ||
/* "yul_optimize_runs/input.yul":80:81 */ | ||
0x00 | ||
/* "yul_optimize_runs/input.yul":135:165 */ | ||
return | ||
stop | ||
|
||
sub_0: assembly { | ||
/* "yul_optimize_runs/input.yul":237:257 */ | ||
0xabc1234500000000000000000000000000000000000000000000000000000000 | ||
/* "yul_optimize_runs/input.yul":277:278 */ | ||
0x00 | ||
/* "yul_optimize_runs/input.yul":270:288 */ | ||
mstore | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters