cfallin requested fitzgen for a review on PR #3698.
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.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
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.
[ ] This has been discussed in issue #..., or if not, please tell us why
here.[ ] A short description of what this does, why it is needed; if the
description becomes long, the matter should probably be discussed in an issue
first.[ ] This PR contains test cases, if meaningful.
- [ ] A reviewer from the core maintainer team has been assigned for this PR.
If you don't know who could review this, please indicate so. The list of
suggested reviewers on the right can help you.Please ensure all communication adheres to the code of conduct.
-->
fitzgen submitted PR review.
fitzgen submitted PR review.
fitzgen created PR review comment:
More nitpicks: thoughts on naming this
set_cold
? To meis_blah
andset_blah
go together. Alsoblock
seems unnecessary since a block is the only argument here; it seems self evident.
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.
fitzgen created PR review comment:
Ditto re
set_cold
here.
cfallin updated PR #3698 from cold-blocks
to main
.
cfallin submitted PR review.
cfallin created PR review comment:
Updated!
cfallin submitted PR review.
cfallin created PR review comment:
Yes, I like that better; changed.
cfallin submitted PR review.
cfallin created PR review comment:
I renamed this to
set_cold_block
rather than justset_cold
for consistency with the other method names, e.g.seal_block
andswitch_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!
cfallin merged PR #3698.
Last updated: Nov 22 2024 at 16:03 UTC