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

compiler optimizations violate oparg invariants #99876

Closed
iritkatriel opened this issue Nov 29, 2022 · 0 comments · Fixed by #99877
Closed

compiler optimizations violate oparg invariants #99876

iritkatriel opened this issue Nov 29, 2022 · 0 comments · Fixed by #99877
Labels
type-feature A feature request or enhancement

Comments

@iritkatriel
Copy link
Member

iritkatriel commented Nov 29, 2022

During code-gen, the compiler makes sure that any opcode that does not HAVE_ARG get an oparg value of 0.

Then, during optimizations some instructions become NOPs but their oparg is not set to 0, so when we come to emit code we need to check HAS_ARG again. It would be better to preserve the invariant in the optimizer instead.

Linked PRs

@iritkatriel iritkatriel added the type-feature A feature request or enhancement label Nov 29, 2022
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Nov 29, 2022
… for an instruction that does not have an arg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
1 participant