Merge remote-tracking branch 'origin/develop' into breaking

This commit is contained in:
chriseth
2020-05-12 17:48:53 +02:00
342 changed files with 4644 additions and 1159 deletions
+1 -1
View File
@@ -43,6 +43,6 @@ add_executable(yul-phaser
yulPhaser/SimulationRNG.h
yulPhaser/SimulationRNG.cpp
)
target_link_libraries(yul-phaser PRIVATE solidity Boost::program_options)
target_link_libraries(yul-phaser PRIVATE solidity Boost::filesystem Boost::program_options)
install(TARGETS yul-phaser DESTINATION "${CMAKE_INSTALL_BINDIR}")
+2
View File
@@ -15,6 +15,8 @@
along with solidity. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <libsolidity/analysis/OverrideChecker.h>
#include <libsolidity/ast/AST.h>
+10 -6
View File
@@ -9,7 +9,7 @@ The input is a set of one or more [Yul](/docs/yul.rst) programs and each sequenc
Optimised programs are given numeric scores according to the selected metric.
Optimisation step sequences are presented in an abbreviated form - as strings of letters where each character represents one step.
The abbreviations are defined in [`OptimiserSuite::stepNameToAbbreviationMap()`](/libyul/optimiser/Suite.cpp#L388-L423).
There's a [table listing available abbreviations in the optimiser docs](/docs/yul.rst#optimization-step-sequence).
### How to use it
The application has sensible defaults for most parameters.
@@ -66,14 +66,18 @@ tools/yul-phaser *.yul \
`yul-phaser` can process the intermediate representation produced by `solc`:
``` bash
solc/solc <sol file> \
--ir \
--no-optimize-yul \
--output-dir <output directory>
solc/solc <sol file> --ir --output-dir <output directory>
```
After running this command you'll find one or more .yul files in the output directory.
These files contain whole Yul objects rather than just raw Yul programs but `yul-phaser` is prepared to handle them.
These files contain whole Yul objects rather than just raw Yul programs but `yul-phaser` is prepared to handle them too.
#### Using optimisation step sequences with the compiler
You can tell Yul optimiser to use a specific sequence for your code by passing `--yul-optimizations` option to `solc`:
``` bash
solc/solc <sol file> --optimize --ir-optimized --yul-optimizations <sequence>
```
### How to choose good parameters
Choosing good parameters for a genetic algorithm is not a trivial task but phaser's defaults are generally enough to find a sequence that gives results comparable or better than one hand-crafted by an experienced developer for a given set of programs.