KEMBAR78
[mypyc] Optimize away some bool/bit registers by JukkaL · Pull Request #17022 · python/mypy · GitHub
Skip to content

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Mar 13, 2024

If a register is always used in a branch immediately after assignment, and it isn't used for anything else, we can replace the assignment with a branch op. This avoids some assignment ops and gotos.

This is not a very interesting optimization in general, but it will help a lot with tagged integer operations once I refactor them to be generated in the lowering pass (in follow-up PRs).

@JukkaL JukkaL merged commit a18a0db into master Mar 14, 2024
@JukkaL JukkaL deleted the mypyc-ir-transform-bool branch March 14, 2024 17:15
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

Successfully merging this pull request may close these issues.

2 participants