Skip to content
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

The tier 2 optimizer specification contains too much boilerplate #118910

Closed
markshannon opened this issue May 10, 2024 · 0 comments
Closed

The tier 2 optimizer specification contains too much boilerplate #118910

markshannon opened this issue May 10, 2024 · 0 comments
Assignees

Comments

@markshannon
Copy link
Member

markshannon commented May 10, 2024

The tier 2 optimizer specification (optimizer_bytecodes.c) contains lots of boilerplate for handling contradictions and running out of space in the optimizer's data structures.
These can be handled but setting flags on the optimizer context and checking those in the abstract interpreter loop.

For example
OUT_OF_SPACE_IF_NULL(res = sym_new_unknown(ctx)); can be replaced with res = sym_new_unknown(ctx)
and

if (!sym_set_type(right, &PyUnicode_Type)) {
    goto hit_bottom;
}

can be replaced with sym_set_type(left, &PyUnicode_Type);

Hopefully this will make the optimizer a bit more approachable and maintainable

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant