Simplify Expr.arithmetic#1661
Merged
Merged
Conversation
Member
Author
|
and of course that breaks constant folding. |
jacqueswww
approved these changes
Oct 28, 2019
Contributor
|
@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)
fubuloubu
reviewed
Oct 31, 2019
Contributor
fubuloubu
left a comment
There was a problem hiding this comment.
Looks cleaner, let's fix the TODOs or at least have a discussion about them
jacqueswww
approved these changes
Nov 7, 2019
Contributor
There was a problem hiding this comment.
Looks good @charles-cooper just add the missing overflow case (or remove the comment) - and I believe we can merge this :)
fubuloubu
approved these changes
Nov 11, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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