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

IR: Add some interpreter-only IR instructions for faster interpretation #19262

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Jun 7, 2024

Mainly just experimenting so far. There are some better wins to be had, but these are easy. These Opt* instructions will only be generated in the very last pass, and only for the IR interpreter - the IR Jits can do similar things themselves when generating native code and we don't want to have them handle more instructions.

part of #19143

Additionally, moves Downcount to the start of each block, saving us from one switch-dispatch per block execution.

Also adds a new optimization pass to take out some unnecessary loads after stores, seen in some games (likely some bad compiler..).

Overall, this seems to be a 5-7% speed boost. Possibly mostly due to the Downcount change...

@hrydgard hrydgard added the IRInterpreter Occurs with IR Interpreter but not with another CPU backend. label Jun 7, 2024
@hrydgard hrydgard added this to the v1.18.0 milestone Jun 7, 2024
@hrydgard hrydgard marked this pull request as ready for review June 7, 2024 21:11
@hrydgard hrydgard merged commit 27815c7 into master Jun 7, 2024
18 checks passed
@hrydgard hrydgard deleted the ir-specialization branch June 7, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IRInterpreter Occurs with IR Interpreter but not with another CPU backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant