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
[YulOpti] Evaluate keccak256 whenever possible #11018
Comments
The libevmasm optimizer can do it. I think it should actually compute it in this case. |
In the end, this is a task for the mload resolver (eliminate the keccak) and the redundant store eliminator (eliminate the mstore as soon as the keccak is gone). |
Even the old optimizer isn't able to do this:
|
Maybe because it deems the result suboptimal? |
I think the old optimizer is not able to do it because of an intermediate jump:
|
Ah, that is probably true! |
Hi everyone! This issue has been closed due to inactivity. |
I believe this should remain open, it's a concrete optimization that should be implemented. |
We have a lot of these optimizations in the backlog and we're starting to think that having an issue for each one is not the best way to keep track of them. May don't have enough detail to just hand the task to someone for implementation. Some of them are even mutually exclusive. It's just a messy wishlist right now and a lot of it may end up never being implemented. @ekpyron suggested creating some document to track them instead. Maybe we should have issues only for more concrete stuff we actually intend to implement in the near future. But since you're clearly interested in this one, I'll reopen it for the time being just so that it remains more visible. |
I don't have a special interest in this one, but I definitely have an interest in optimizations in general. I commented because I felt that if this was closed it would get lost. I support whatever you consider the most effective way to keep track of optimization opportunities. |
This issue has been marked as stale due to inactivity for the last 90 days. |
Hi everyone! This issue has been automatically closed due to inactivity. |
For example, if we have a storage variable
uint[] a
, the following is the optimized IR code for computingarr[10] = 5
:Here value of
_1
is0
.It would be nice if we could compute this hash, and also avoid the
mstore
.Was bought by in the forum by @frangio https://forum.soliditylang.org/t/enable-disable-language-features-to-save-gas/84/20
The text was updated successfully, but these errors were encountered: