Skip to content
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

More pop removal in peephole optimizer. #12795

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

ekpyron
Copy link
Member

@ekpyron ekpyron commented Mar 15, 2022

Depends on #12759

@ekpyron
Copy link
Member Author

ekpyron commented Mar 15, 2022

Doesn't seem to add much on top of #12759 for the external test benchmarks:

bleeps
   ir-optimize-evm+yul
     bytecode_size :  -0.02 %
     method_gas :  0.00 %
elementfi
   ir-optimize-evm+yul
     bytecode_size :  -0.01 %
     deployment_gas :  -0.01 %
     method_gas :  0.01 %
ens
   ir-optimize-evm+yul
     bytecode_size :  -0.09 %
     deployment_gas :  -0.07 %
     method_gas :  0.00 %
gnosis
   ir-optimize-evm+yul
     bytecode_size :  -0.06 %
     deployment_gas :  -0.13 %
     method_gas :  -0.00 %
pool-together
   ir-optimize-evm+yul
     bytecode_size :  -0.02 %
     deployment_gas :  -0.02 %
     method_gas :  -0.00 %
prb-math
   ir-optimize-evm+yul
     bytecode_size :  0.00 %
     deployment_gas :  -0.00 %
trident
   ir-optimize-evm+yul
     bytecode_size :  -0.05 %
     deployment_gas :  -0.03 %
     method_gas :  -0.02 %
yield_liquidator
   ir-optimize-evm+yul
     bytecode_size :  -0.02 %
     deployment_gas :  -0.04 %
     method_gas :  0.00 %
zeppelin
   ir-optimize-evm+yul
     bytecode_size :  -0.07 %
     deployment_gas :  -0.07 %
     method_gas :  -0.00 %

@ekpyron ekpyron added the has dependencies The PR depends on other PRs that must be merged first label Mar 15, 2022
@ekpyron ekpyron force-pushed the morePopRemovalInPeepholeOptimizer branch from c57c5ad to 60fa8db Compare March 15, 2022 18:03
Base automatically changed from evmCodeTransformAvoidPops to develop March 15, 2022 18:14
@ekpyron ekpyron removed the has dependencies The PR depends on other PRs that must be merged first label Mar 15, 2022
@ekpyron ekpyron force-pushed the morePopRemovalInPeepholeOptimizer branch from 60fa8db to 4b9c017 Compare March 16, 2022 14:35
std::back_insert_iterator<AssemblyItems> _out
)
{
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mechanism could even be extended more:
We have op1, op2, op3, returnRevert where:

  • op1 is side-effect free
  • op2.args == 0, op2.return >= 1
  • op3.args <= op2.return
  • (op2.return + op3.return) - (op2.args + op3.args) >= 2
  • returnRevert is return or revert

@chriseth chriseth merged commit 430ecb6 into develop Mar 17, 2022
@chriseth chriseth deleted the morePopRemovalInPeepholeOptimizer branch March 17, 2022 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants