Christian Parpart
a1ec49409d
Yul] RedundantAssignEliminator: Implements break/continue handling within ForLoop.
2019-03-26 17:36:43 +01:00
Alex Beregszaszi
c26ffa737e
Use move semantics on StackToDeepError
2019-03-26 16:15:16 +00:00
chriseth
caddce6ef0
Detect duplicate cases based on integer value of case label.
2019-03-25 12:38:22 +01:00
chriseth
8514c0bc60
Provide max iterations for stack compressor as parameter.
2019-03-20 15:07:05 +01:00
chriseth
aa9a2935ac
Properly determine whether a variable can be eliminated or not.
2019-03-20 15:07:05 +01:00
chriseth
38cbf8d230
Pass "optimize stack allocation" flag down to the stack compressor.
2019-03-20 15:03:27 +01:00
chriseth
93027c40b6
Merge pull request #6322 from ethereum/asm-datasize-exception-fix
...
Improve exception information in Yul function datasize(name) and dataoffset(name).
2019-03-20 10:50:49 +01:00
Alex Beregszaszi
5245a66d91
Merge pull request #6318 from ethereum/signal-failure-and-such
...
Allow simplification patterns to signal failure
2019-03-20 03:38:51 +00:00
Christian Parpart
7f7f44dd63
Improve exception information in Yul function datasize(name) and dataoffset(name).
...
Makes sure we properly throw a detailed exception instead of an out_of_range from std::map.
2019-03-19 17:17:32 +01:00
Alex Beregszaszi
f95388011b
Allow simplification patterns to signal failure
2019-03-19 15:51:52 +01:00
Christian Parpart
89f1dbfbb6
[Yul] Refactors RedundantAssignEliminator for future changes wrt. break/continue statements.
2019-03-19 12:24:45 +01:00
chriseth
500843f9c5
Merge pull request #6242 from ethereum/yul-bc-dataflow
...
Yul dataflow analysis for continue/break statements
2019-03-14 16:34:34 +01:00
Christian Parpart
57bcb8ba83
[yul] Ensures DataFlowAnalyzer works fine with break/continue statements just like without.
2019-03-14 16:18:45 +01:00
chriseth
49d914a391
Fix and test yul stack optimization flag for commandline interface.
2019-03-14 15:34:23 +01:00
chriseth
6d1ed93247
Use stack optimizations.
2019-03-14 15:34:23 +01:00
chriseth
62d8080a19
Update optimiser readme.
2019-03-12 22:02:09 +01:00
Christian Parpart
05e2d362c8
[Yul] Adds break/continue statements and some general tests for for-loop syntax.
2019-03-11 15:05:05 +01:00
chriseth
791fde953d
First simplify switch with known constant expression.
2019-03-06 21:32:55 +01:00
chriseth
21115f8050
Fix visitation order bug for structural simplifier.
2019-03-06 19:34:07 +01:00
Mathias Baumann
21322dae29
YulOpt: Remove empty cases
2019-03-06 19:02:23 +01:00
Mathias Baumann
be52aa3181
YulOpt: Move if-branches into functions
2019-03-06 19:01:05 +01:00
Mathias Baumann
3ce7069766
YulOpt: Remove empty cases
2019-03-06 18:39:44 +01:00
Mathias Baumann
433175b19e
YulOpt: Add comment about optimization
2019-03-06 18:39:44 +01:00
Mathias Baumann
db3bea7b56
Use reference for so we have to type less
2019-03-06 18:39:44 +01:00
chriseth
831353c590
Merge pull request #6172 from ethereum/runYulOptAsLongAsHelpful
...
[Yul] Run yul optimizer until it has no effect anymore.
2019-03-06 11:41:22 +01:00
chriseth
f35694f655
Run yul optimizer until it has no effect anymore.
2019-03-05 20:30:13 +01:00
Mathias Baumann
f6e09d6368
YulOpt: Extend StructuralSimplifier to work with all types
2019-03-05 18:39:27 +01:00
Mathias Baumann
a52b50d770
libyul: Change assertThrow() to yulAssert()
2019-03-05 18:39:27 +01:00
Mathias Baumann
921d52bfcd
Move Literal to u256 conversions to extra functions
...
That way we can reuse them at different places
2019-03-05 18:39:27 +01:00
chriseth
d0ab5454f8
Merge pull request #6171 from ethereum/ignorePrefixWhileInlining
...
Do not prepend function name to all variables when inlining.
2019-03-05 11:36:53 +01:00
Alex Beregszaszi
c64d42e6f5
Use currentToken()/advance() helpers from ParserBase consistently in AsmParser
2019-03-04 22:56:36 +01:00
chriseth
3f784d6e00
Do not prepend function name to all variables when inlining.
2019-03-04 18:07:00 +01:00
Christian Parpart
609855546e
Yul: Adds optimizer pass to make variable names suffix-canonical.
2019-03-04 17:26:56 +01:00
Alex Beregszaszi
9fc7706537
Change unreachable parser error to assertion in AsmParser
2019-03-04 15:08:46 +01:00
chriseth
8f5e12c192
Make unavailable opcodes errors.
2019-02-28 22:20:01 +01:00
Mathias Baumann
c686a65876
Yul Optimizer: reduce switches with const arguments
2019-02-28 15:43:10 +01:00
chriseth
477c53a46f
Fix expression simplifying by moving from SSAValueTracker to DataFlowAnalyzer as a base.
2019-02-27 16:14:39 +01:00
chriseth
9b7d793407
Fix windows build.
2019-02-26 19:43:24 +01:00
Alex Beregszaszi
cb7b053a4a
Consider extcodehash as part of Constantinople
2019-02-26 12:40:31 +00:00
Alex Beregszaszi
5fc8e29fff
More granular error reporting in warnOnInstruction in AsmAnalysis
2019-02-26 12:39:15 +00:00
chriseth
62e650dc42
Remove cpp files without symbols.
2019-02-25 17:23:11 +01:00
Leonardo Alt
2405b2151a
EVMVersion in langutil namespace instead of solidity
2019-02-25 15:29:57 +01:00
chriseth
8aeebf7fcd
Merge pull request #6071 from ethereum/moveEVMVersionToEVMDialect
...
Make EVM version part of EVM dialect.
2019-02-25 11:56:53 +01:00
chriseth
7f5b335b47
Make EVM version part of EVM dialect.
2019-02-21 21:59:46 +01:00
chriseth
91fb2d094d
Clear state when entering new function.
2019-02-21 20:04:20 +01:00
Alex Beregszaszi
fcf884f201
Do not ignore fatal error in AsmParser for inline assembly
2019-02-21 16:18:53 +00:00
chriseth
15d275ed37
Merge pull request #6023 from ethereum/assignment-whitespace-op
...
Add extra token for assembly assignment
2019-02-21 14:43:29 +01:00
Mathias Baumann
f395d5bab4
Add extra token for assembly assignment
...
Adding an extra token for := prevents whitespace between : = being valid
2019-02-21 13:58:21 +01:00
chriseth
947215a901
Take builtin functions into account in the compilability checker.
2019-02-21 12:13:42 +01:00
chriseth
00084a9bd7
Merge pull request #6027 from ethereum/failEnErrorListNonEmpty
...
Make analysis success not only dependent on flag but also on error list.
2019-02-20 15:19:48 +01:00
chriseth
372853b192
Make analysis success not only dependent on flag but also on error list.
2019-02-20 14:57:58 +01:00
Alex Beregszaszi
0f1be75f97
Assert for parserResult in optimize in AssemblyStack
2019-02-20 13:54:24 +00:00
chriseth
b4cd2d6a93
Properly detect name clashes with functions before their definition.
2019-02-18 14:51:05 +01:00
Daniel Kirchner
8ca6715e18
More style checks.
2019-02-14 11:41:20 +01:00
chriseth
b1df990a0f
Merge pull request #5990 from ethereum/provideAccessToAssmeblyAST
...
Provide access to assembly ast
2019-02-13 17:38:22 +01:00
chriseth
c5879589af
Merge pull request #5998 from ethereum/codingStyleCheck
...
More coding style checks
2019-02-13 17:36:34 +01:00
chriseth
1a823f0bf8
Fix tabs/spaces.
2019-02-13 17:05:48 +01:00
chriseth
17ea467e5b
Fix style of "const".
2019-02-13 16:34:53 +01:00
chriseth
3a3ed1c6b5
Fix assertion concerning jumps in strict assembly.
2019-02-13 15:57:14 +01:00
chriseth
a344381d5e
Provide access to AssemblyStack's AST.
2019-02-13 14:19:56 +01:00
chriseth
0bd049c849
Adapet uses of AssemblyStack.
2019-02-13 12:23:07 +01:00
chriseth
d073eb1544
Move AssemblyStack to libyul.
2019-02-13 12:23:07 +01:00
chriseth
02373c2225
Adjust uses of AsmCodeGen.
2019-02-13 11:35:49 +01:00
chriseth
1ff6f2c71c
Move AsmCodeGen.
2019-02-13 11:20:15 +01:00
chriseth
83083d2208
Stack compressor.
2019-02-11 15:48:29 +01:00
chriseth
5a34743d88
Allow optimizer steps to run on FunctionDefinition and group suite.
2019-02-11 15:48:29 +01:00
chriseth
b34e104173
Make dialect a shared pointer.
2019-02-11 15:48:29 +01:00
chriseth
22c8d74a8a
Store all stack errors before they are thrown.
2019-02-04 17:32:05 +01:00
chriseth
77baf6caf7
Compilability checker.
2019-02-04 17:32:05 +01:00
chriseth
4f641e3732
Helper function for analysis.
2019-02-04 17:32:05 +01:00
chriseth
dd5b43741c
No-output Assembly.
2019-02-04 17:32:04 +01:00
chriseth
11969cd760
Add some more explicit moves required in some compiler and boost version combinations.
2019-02-04 15:50:41 +01:00
chriseth
17a1e7aed5
Better error message for out of stack in assembly.
2019-01-30 12:24:10 +01:00
Alex Beregszaszi
ee09d54525
Change FIXMEs into TODOs where appropriate
2019-01-29 00:35:23 +00:00
Alex Beregszaszi
2fc7928697
Merge pull request #5864 from ethereum/tuneOptOrder
...
Some optimizer tuning.
2019-01-28 13:50:09 +00:00
chriseth
12e2187661
Some tuning.
2019-01-24 23:06:01 +01:00
chriseth
1fc98b8133
Fix optimizer suite.
2019-01-24 20:42:32 +01:00
Daniel Kirchner
29f66b2674
Stabilize SSAReverser.
2019-01-17 21:05:32 +01:00
Daniel Kirchner
fd16585724
Undo second SSA transformation and add more tests.
2019-01-17 20:37:43 +01:00
Daniel Kirchner
6de2d92f20
Add SSAReverser to the yul optimiser.
2019-01-17 20:37:43 +01:00
Christian Parpart
065c3c87af
libyul: changing some AST members from shared_ptr<> to unique_ptr<>
...
* Some spaces look a little more verbose now, but that shouln't be a problem as it also should raise readability, too.
* This makes some use of return-value-optimizations also.
2019-01-16 14:58:59 +01:00
Daniel Kirchner
81f24f24e6
Add equivalent function combiner as Yul optimizer step.
2019-01-15 17:21:03 +01:00
Daniel Kirchner
4c8f8e9491
Disallow mismatching types in switch cases and detect duplicates by value for number literals.
2019-01-15 16:32:21 +01:00
Daniel Kirchner
5a99623fec
Avoid explicit conversion from Block to Statement in CodeSize visit.
2019-01-11 12:52:24 +01:00
chriseth
d9c6773664
Adjust inlining thresholds.
2019-01-09 16:57:33 +01:00
chriseth
edda79eec5
Variables are free with regards to code size.
2019-01-09 16:57:33 +01:00
chriseth
5b8b016fae
Use the block flattener.
2019-01-08 16:02:14 +01:00
chriseth
f5b24a38b8
Make function grouper idempotent.
2019-01-08 15:05:09 +01:00
chriseth
5b73c2ae3b
Take special functions that require literals into account.
2019-01-07 17:23:38 +01:00
chriseth
9222eff08f
Make the dialect available everywhere.
2019-01-07 16:41:03 +01:00
chriseth
2e9c70add0
Use rematerializer if variable is unreferenced or value is "cheap".
2019-01-07 14:03:32 +01:00
Christian Parpart
62fe57479e
make use of C++ = default
constructor declarations as well as more non-static member initialization syntax.
2018-12-19 11:26:42 +01:00
chriseth
7d3727bbf7
Merge pull request #5665 from ethereum/cmakeHeaders
...
Add headers to targets in CMakeLists.txt.
2018-12-17 17:47:38 +01:00
Daniel Kirchner
2353f73c39
Add headers to targets in CMakeLists.txt.
2018-12-17 15:01:02 +01:00
chriseth
bf7d71d6b3
Merge pull request #5613 from ethereum/yulStringLiterals
...
[Yul] Use C++ user-defined literals for creating YulString constants.
2018-12-17 14:07:24 +01:00
chriseth
bc22a25a60
Remove VarDeclPropagator.
2018-12-13 16:51:10 +01:00
chriseth
6c6a53a439
Do not create unassigned variables.
2018-12-13 16:51:10 +01:00
chriseth
11209ec48a
Add variable declaration initializer.
2018-12-13 16:49:04 +01:00
chriseth
b11d413720
Consider return variables to be zero initially.
2018-12-13 16:02:30 +01:00
chriseth
1d274a8924
Merge pull request #5644 from ethereum/noInlineIntoLarge
...
[Yul] Do not inline into already big functions.
2018-12-13 15:57:49 +01:00