[m-rev.] for post-commit review: merge MLDS switch arms with identical code
Peter Wang
novalazy at gmail.com
Tue Mar 5 17:51:54 AEDT 2024
On Tue, 05 Mar 2024 13:53:48 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> Merge identical cases in MLDS tag switches.
>
> compiler/ml_tag_switch.m:
> If a HLDS switch arm has several cons_ids that differ in what kinds
> ptags they correspond to (e.g. one may use an unshared primary tag value,
> one may use a primary tag value shared by several local secondary tags,
> and one may use a primary tag value shared by several remote secondary
> tags, then we normally handle them separately. However, it is possible
> for e.g. *all* the (local or remote) secondary tag values corresponding
> to a primary tag value to belong to the same HLDS switch arm. In that
> case, we can merge the MLDS switch case we generate for those cons_ids
> with the MLDS switch cases of all the other primary tag values that
> also belong to the same HLDS switch arm. With this diff, we do so.
>
> compiler/ml_switch_gen.m:
> Add a comment.
That looks fine. I fixed a couple of typos in comments.
Peter
More information about the reviews
mailing list