Stream: git-wasmtime

Topic: wasmtime / PR #3698 Cranelift: add support for cold blocks.


view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 01:33):

cfallin requested fitzgen for a review on PR #3698.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 01:33):

cfallin opened PR #3698 from cold-blocks to main:

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.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 18:00):

cfallin edited PR #3698 from cold-blocks to main:

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 #2747.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 18:46):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 18:46):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 18:46):

fitzgen created PR review comment:

More nitpicks: thoughts on naming this set_cold? To me is_blah and set_blah go together. Also block seems unnecessary since a block is the only argument here; it seems self evident.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 18:46):

fitzgen created PR review comment:

nitpick: single, short sentence followed by an empty line, followed by additional details makes for better rustdocs:

    /// Mark a block as "cold".
    ///
    /// This will try to move it out of the ordinary path of execution
    /// when lowered to machine code.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 18:46):

fitzgen created PR review comment:

Ditto re set_cold here.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:17):

cfallin updated PR #3698 from cold-blocks to main.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:18):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:18):

cfallin created PR review comment:

Updated!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:18):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:18):

cfallin created PR review comment:

Yes, I like that better; changed.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:19):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:19):

cfallin created PR review comment:

I renamed this to set_cold_block rather than just set_cold for consistency with the other method names, e.g. seal_block and switch_to_block; the builder deals with more than just blocks (as opposed to the block-layout internal API above) so I think this is probably clearer. Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 19 2022 at 20:58):

cfallin merged PR #3698.


Last updated: Nov 22 2024 at 16:03 UTC