-
-
Notifications
You must be signed in to change notification settings - Fork 819
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
Simplify Expr.arithmetic #1661
Simplify Expr.arithmetic #1661
Conversation
and of course that breaks constant folding. |
@charles-cooper it's not breaking constant folding, you just have to fix the test to extract the constant value differently now that the LLL output has changed (which makes sens IMO) ;) |
the safe add now generates different code, so just look for the return statement.
- Always precompute both sides into an LLL reference (pre_alloc for call no longer needed), so generally more gas efficient if the arguments are more than ~2 ops - Remove a jumpi for mul uint256 - Simplify type calculation / pos calculation - Use clamps instead of seq-assert where it's clearer - Use similar styles for similar output (e.g. mul uint256 looks like mul int128)
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 cleaner, let's fix the TODOs or at least have a discussion about them
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 good @charles-cooper just add the missing overflow case (or remove the comment) - and I believe we can merge this :)
What I did
no longer needed), so generally more gas efficient if the arguments
are more than ~2 ops
int128)
How I did it
Use references to break the exponential behavior in #1658
How to verify it
Description for the changelog
Cute Animal Picture