-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Add simplification rules for mod(mul(X, Y), A) & mod(add(X, Y), A)
#12976
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
Conversation
|
Let me rebase this to see if the tests pass. |
|
I have rebased changes to make clear what still needs to be fixed. |
|
The assertion hit by the tests is |
Thanks for clarifying! The output wasn't really telling me much. I could make that change. Do you have a name in mind for the flag? And do you recommend passing that flag down to each I notice that there's a few rules, |
Ah, right! I didn't realize myself that we don't set the evm version for legacy code generation. In that case, it makes sense to just reuse that. You can add a flag only to the rule list I'd also add a comment before conditionally adding the new rules stating something like: |
|
@ekpyron Looks like that solved it! Tests are passing now 🙌 |
|
We'll still need a changelog entry for this - apart from that I think we can merge. |
|
I've added changelog entries as well. Feel free to edit if necessary. |
This fixes #10688
I'm not sure about the placement of these rules, it just seemed like they should be somewhere above the following rule:
Replace MOD X, <power-of-two> with AND X, <power-of-two> - 1