[m-rev.] for post-commit review: optimize more computed_gotos

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Jul 15 01:10:16 AEST 2024



On Fri, 12 Jul 2024 15:51:40 +1000 (AEST), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> That test will be redundant in cases where SelectorRval is computed
> as the primary tag bits of a word. I intend to add a new field to
> computed_goto instructions that says whether the process of computing
> SelectorRval has put a limit on its maximum value, and if so, what
> that limit is. Then we can add this test only when the limit is either
> missing or too high. (Code that constructs such instructions is already
> supposed to ensure that SelectorRval is non-negative, so the lower
> bound is always zero.)
> 
> The addition of the test against bits_per_uint will change the performance
> characteristics of the code. In cases where a label is shared by only two values,
> generating SelectorRval = Val1 || SelectorRval = Val2 would probably be better
> than generating a test against bits_per_int, indexing into the mask, and testing
> the result.

The attached diff should fix the issue Peter identified. For post-commit review
by him.

Zoltan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Log.cg
Type: application/octet-stream
Size: 1277 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240715/76863700/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DIFF.cg
Type: application/octet-stream
Size: 27951 bytes
Desc: not available
URL: <http://lists.mercurylang.org/archives/reviews/attachments/20240715/76863700/attachment-0003.obj>


More information about the reviews mailing list