[m-rev.] for post-commit review: ground terms as constant structures

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jun 18 16:24:11 AEST 2012


On Mon, 11 Jun 2012, Zoltan Somogyi wrote:

> If the backend supports constant structures, and we do not need unifications
> to retain their original shapes, then convert each from_ground_term scope
> into a unification with a cons_id that represents the ground term being
> built up.
>
> This speeds up the compilation of training_cars_full.m by about 6%.

Out of interest, how does the compiler now perform on this benchmark?

...

> Index: compiler/term_constr_build.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/term_constr_build.m,v
> retrieving revision 1.35
> diff -u -b -r1.35 term_constr_build.m
> --- compiler/term_constr_build.m	8 Jun 2012 15:37:01 -0000	1.35
> +++ compiler/term_constr_build.m	11 Jun 2012 03:03:01 -0000
> @@ -214,8 +214,7 @@
>         Context, VarTypes, Zeros, SizeVarMap, SCC,
>         Options ^ tbo_failure_constrs, Options ^ tbo_arg_size_only),
>
> -    % Traverse the HLDS and construct the abstract version of
> -    % this procedure.
> +    % Traverse the HLDS and construct the abstract version of this procedure.
>     build_abstract_goal(Goal, AbstractBody0, Info0, Info),
>     IntermodStatus = Info ^ tti_intermod_status,
>     HeadSizeVars   = prog_vars_to_size_vars(SizeVarMap, HeadProgVars),
> @@ -883,6 +882,8 @@
>         % The only valid higher-order unifications are assignments.
>         % For the purposes of the IR analysis, we can ignore them.
>         % We can also ignore unifications that build constant terms.
> +        % XXX Should we process constant terms that are NOT typeinfos
> +        % or typeclass infos? We have no test cases (yet) that need that.

Yes -- I will fix this one.

The rest of the diff looks ok.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list