[m-rev.] for review: simplify construction of arm_instmaps

Peter Wang novalazy at gmail.com
Sun Mar 7 11:56:01 AEDT 2021


On Sun, 07 Mar 2021 00:07:26 +1100 "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For review by Peter. If ok, can I commit it without causing
> you conflicts? If not, I will wait.
> 
> Zoltan.

> Constructs arm_instmaps directly
> 
> compiler/modecheck_goal.m:
>    We used to construct a list of arm_instmaps by zipping a list of instmaps
>    with the corresponding list of disjuncts. Avoid this extra traversal by
>    constructing each arm_instmap when the disjunct it is for is processed.
>    (We do have to rebuild each arm_instmap if there are some nonlocal vars
>    that all the disjuncts construct using from_ground_term scopes, but
>    that is rare.)
> 
>    Pass the initial instmap to the loop that processed each disjunct,
>    instead of each iteration resetting the instmap for the next iteration.
>    This simplifies correctness arguments.

That looks fine. Go ahead and commit it.

Peter


More information about the reviews mailing list