-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Implement the binary search dispatch for the IR codegen #12688
Comments
Related: #12650. |
I would prefer binary search (or constant-time search) to be implemented for all switch statements instead of writing custom code for the external dispatch. This has the advantage that it 1) can use jumps because it will be in the evm code gen and 2) it automatically applies to the external and the internal dispatch. |
I'm not sure this is possible for constant-time search without a special case for external dispatch. The last developments in #12650 make use of the fact that selectors are already random, so re-hashing is not needed. This will not be true of an arbitrary |
While that is true, we can still try. Since the case values are compile-time constants, we will know if it failed or not. |
This issue has been marked as stale due to inactivity for the last 90 days. |
Hi everyone! This issue has been automatically closed due to inactivity. |
The binary search for the function dispatch seems to be only implemented in the legacy codegen.
Context:
solidity/libsolidity/codegen/ContractCompiler.cpp
Line 325 in da50176
Implement the same for the IR based codegen.
The text was updated successfully, but these errors were encountered: