Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSimplify Expr.arithmetic #1661
Merged
Simplify Expr.arithmetic #1661
Conversation
This comment has been minimized.
This comment has been minimized.
and of course that breaks constant folding. |
This comment has been minimized.
This comment has been minimized.
@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)
adhere to pylint's draconian whitespace rules
Looks cleaner, let's fix the TODOs or at least have a discussion about them |
Looks good @charles-cooper just add the missing overflow case (or remove the comment) - and I believe we can merge this :) |
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.
charles-cooper commentedOct 26, 2019
•
edited
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