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

Add a way to mark blocks as cold #2747

Closed
bjorn3 opened this issue Mar 20, 2021 · 1 comment · Fixed by #3698
Closed

Add a way to mark blocks as cold #2747

bjorn3 opened this issue Mar 20, 2021 · 1 comment · Fixed by #3698

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Mar 20, 2021

Feature

I want to move all cold code to the end of the function to reduce the average amount of jumps and improve code locality.

Benefit

This can improve performance in the common case.

@pepyakin
Copy link
Collaborator

That may also become eventually useful for implementing supporting the branch-hinting proposal.

cfallin added a commit to cfallin/wasmtime that referenced this issue Jan 19, 2022
This PR adds a flag to each block that can be set via the frontend/builder
interface that indicates that the block will not be frequently
executed. As such, the compiler backend should place the block "out of
line" in the final machine code, so that the ordinary, more frequent
execution path that excludes the block does not have to jump around it.

This is useful for adding handlers for exceptional conditions
(slow-paths, guard violations) in a way that minimizes performance cost.

Fixes bytecodealliance#2747.
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 a pull request may close this issue.

2 participants