-
Notifications
You must be signed in to change notification settings - Fork 24
[EVM] Expand SELECT into arithmetic operations #877
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
base: main
Are you sure you want to change the base?
Conversation
|
Expanding a select instruction with non-constant operands into a sequence of arithmetic operations may lead to significant performance regressions. In the linearized form, both the "true" and "false" values must always be computed, whereas when lowered to CFG form, each value is only evaluated if it is actually needed. This effect can be observed in tests/solidity/complex/defi/UniswapV4/test.json, where we have the following LLVM IR:
In the linearized code, we have to always calculate fragments like:
Whereas in the CFG form they are not executed at all on some inputs. |
2d67d84
to
c42af9e
Compare
I see, bad idea - it seems. |
I guess it's useful in some cases, but we need perform some analysis where this reasonable where it's not, bot not expand it unconditionally. Let's create an issue for this? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #877 +/- ##
==========================================
- Coverage 30.07% 30.06% -0.01%
==========================================
Files 2441 2441
Lines 807942 807949 +7
Branches 176474 176475 +1
==========================================
- Hits 242962 242946 -16
- Misses 522806 522846 +40
+ Partials 42174 42157 -17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📊 Excel Report Available Benchmarks measured for:
|
Code Review Checklist
Purpose
Ticket Number
Requirements
Implementation
Logic Errors and Bugs
code does not behave as intended?
that could break the code?
Error Handling and Logging
be added or removed?
written in a way that allows for easy
debugging?
Maintainability
Dependencies
Security
Performance
system performance?
performance of the code significantly?
Testing and Testability
that should be tested in addition?
Readability
smaller methods?
different function, method or variable names?
file/folder/package?
restructured to have a more intuitive control
flow?
better?
understandable?
Documentation
Best Practices
Experts' Opinion
expert or a usability expert, should look over
the code before it can be accepted?