-
Notifications
You must be signed in to change notification settings - Fork 6.3k
[CLI] Deduplicate optimizer initialization #11730
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
Conversation
753d8ef to
301415f
Compare
|
|
||
| if (m_options.optimizer.yulSteps.has_value()) | ||
| settings.yulOptimiserSteps = m_options.optimizer.yulSteps.value(); | ||
| settings.optimizeStackAllocation = settings.runYulOptimiser; |
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.
Note that this line was not in assemble(), only in compile(). I removed it because it's redundant anyway. With current defaults in OptimierSettings the value of optimizeStackAllocation always matches runYulOptimiser. On the CLI they can only be different if you use --no-optimize-yul and that option is invalid in assembly mode.
301415f to
272f53b
Compare
272f53b to
84f66bd
Compare
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.
Looks fine apart from maybe the changelog entry.
Although (I keep saying this), I still think it's a waste of time and energy meddling with this infernal command line interface instead of replacing it by a translation layer to StandardCompiler right away :-).
But we won't be throwing out Also, I went though |
Well ok, fair enough - you may be right that that may in fact be the best way to achieve the same thing. |
84f66bd to
9737356
Compare
…ndLineOptions into a common function
9737356 to
1e4cef8
Compare
Related to #11720.
Also implements part of #11629.
There were multiple places that initialized
OptimiserSettings: it's needed for validation inCommandLineParserand later inCommandLineInterfaceto actually initialize the compiler. In both cases the initialization was performed separately for the compiler and for the assembler. Now there's a single function that creates the struct based onCommandLineOptions.This change would result in optimizer settings being parsed (but unused) in linker mode so I also made the compiler reject them in this mode and also in Standard JSON mode.