[m-rev.] for post-commit review: direct args and ptag 6

Peter Wang novalazy at gmail.com
Mon Feb 5 11:51:07 AEDT 2018


On Sun, 04 Feb 2018 15:07:30 +1100 (AEDT), "Zoltan Somogyi" <zoltan.somogyi at runbox.com> wrote:
> For post commit review by Peter. The DIFF.direct_arg_tags shows
> the effect of this diff on the C code we generate for the direct_arg_tags.m
> test case.
> 
> diff --git a/compiler/du_type_layout.m b/compiler/du_type_layout.m
> index e272b9d..dd0e316 100644
> --- a/compiler/du_type_layout.m
> +++ b/compiler/du_type_layout.m
> @@ -879,16 +879,9 @@ convert_direct_arg_functors_if_suitable(Target, ModuleName, DebugTypeRep,
>                          !NextTag, !CtorTags),
>                      % We prefer to allocate primary tags to direct argument
>                      % functors.
> -                    (
> -                        NonDirectArgFunctors = [],
> -                        MaxTagForDirect = MaxTag
> -                    ;
> -                        NonDirectArgFunctors = [_ | _],
> -                        MaxTagForDirect = MaxTag - 1
> -                    ),
>                      assign_direct_arg_tags(TypeCtor, DirectArgFunctors,
> -                        !NextTag, MaxTagForDirect, LeftOverDirectArgFunctors,
> -                        !CtorTags),
> +                        !NextTag, MaxTag, NonDirectArgFunctors,
> +                        LeftOverDirectArgFunctors, !CtorTags),
>                      assign_unshared_tags(TypeCtor,
>                          LeftOverDirectArgFunctors ++ NonDirectArgFunctors,
>                          !.NextTag, MaxTag, [], !CtorTags),

Thanks.

It may be clearer to split the list of direct arg functors here (into
those that can be realised vs the leftovers), instead of inside the
assign_direct_arg_tags loop. No real need to change it, though.

Peter


More information about the reviews mailing list