-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce global optimiser settings. #5959
Conversation
If we agree on the metadata strings, we can already merge it like this. |
d5e72d0
to
1a34e66
Compare
Codecov Report
@@ Coverage Diff @@
## develop #5959 +/- ##
===========================================
+ Coverage 87.91% 87.92% +<.01%
===========================================
Files 374 375 +1
Lines 35771 35973 +202
Branches 4220 4245 +25
===========================================
+ Hits 31447 31628 +181
- Misses 2901 2910 +9
- Partials 1423 1435 +12
|
Compilation error for emscripten:
I believe we already had something like that in the past. Anyone remembers how we solved it? |
@chriseth The emscripten compile error is due to the emscripten build having 32-bit
C++17 would be nice here, then we could do
Maybe there's a nicer solution, but that's the problem in any case. EDIT:
|
322a657
to
e2eb48a
Compare
I suggest the following:
In 0.6.0 we may revisit dropping |
From off-line discussion: it seems that introducing a new sub-level for optimiser "details" is a better approach. Example: // Optional: Optimizer settings. The fields "enabled" and "runs" are deprecated
// and are only given for backwards-compatibility.
optimizer: {
enabled: true,
runs: 200,
details: {
// peephole defaults to "true"
peephole: true,
// jumpdestRemover defaults to "true"
jumpdestRemover: true,
orderLiterals: false,
deduplicate: false,
cse: false,
constantOptimizer: false,
yul: true
yulDetails: {}
},
}, Subtleties:
The |
If "details" is not a member, optimizer will be in "default disabled" mode, which mean peephole and jumpdest remover are still on. |
@axic should we also add a "stackAllocation" option to the optimizer? This would then activate the |
Hm, that could just be the yul optimizer option. |
Updated. |
All of the gas tests are broken and every single one becomes more expensive. Any idea why? This PR shouldn't change behaviour of the optimiser. |
@@ -153,7 +153,7 @@ bytes compileFirstExpression( | |||
parametersSize-- | |||
); | |||
|
|||
ExpressionCompiler(context).compile(*extractor.expression()); | |||
ExpressionCompiler(context, dev::test::Options::get().optimize).compile(*extractor.expression()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for these tests to change was that we did not take the global test parameter into account before. I think this is a good test, because it shows the effect of order literals
optimization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But all the deployment sizes increased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the non-optimized expectations are unchanged.
Compiler compiler(dev::test::Options::get().evmVersion()); | ||
Compiler compiler( | ||
dev::test::Options::get().evmVersion(), | ||
dev::test::Options::get().optimize ? OptimiserSettings::enabled() : OptimiserSettings::minimal() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, optimizer setting was ignored before.
I also don't understand why the commandline tests changed - will have to investigate. It might be that "stack allocation" was activated before when the optimizer was activated, now it can only be activated manually. |
Ok, the problem in the commandline tests was actually related to the invalid reference noted above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the assumption that apart from the const&
change this is identical to last week.
Yep, removed the reference and also removed the test expectation changes the reference caused. |
Replaces PR #2600
References issue #1658
Apart from exporting the settings via the metadata, this should be a pure refactoring.
Still todo: