[m-dev.] for review: type specialization [1]

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 18 17:59:44 AEDT 1999


On 18-Feb-1999, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> Hi,
> 
> > >  	list__foldl(dead_pred_elim_initialize, PredIds, 
> > >  		DeadInfo0, DeadInfo1),
> > >  	dead_pred_elim_analyze(DeadInfo1, DeadInfo),
> > > -	DeadInfo = dead_pred_info(ModuleInfo1, _, _, NeededPreds, _),
> > > +	DeadInfo = dead_pred_info(ModuleInfo1, _, _, NeededPreds2, _),
> > > +
> > > +	%
> > > +	% If a predicate is not needed, predicates which were added in
> > > +	% make_hlds.m to force type specialization are also not needed.
> > > +	% Here we add in those which are needed.
> > > +	%
> > 
> > Why are you doing that _after_ dead_pred_elim_analyze?
> 
> There are no calls to the specialized versions of predicates before
> higher_order.m is run, so dead_pred_elim_analyze thinks that they are
> not needed. This section makes sure that specialized versions are not
> removed before higher_order.m has a chance to introduce calls to them.

OK.  Maybe you could add something like that to the comment.

> > > +:- pred compute_extra_typeinfos(higher_order_info::in, list(prog_var)::in,
> > > +		list(prog_var)::out, list(type)::out) is det.
> > 
> > How about a comment explaining what this predicate is supposed to do?
> 
> "
>         % If `--typeinfo-liveness' is set, specializing type `T' to `list(U)'
>         % requires passing in the type-info for `U'. This predicate
>         % works out which extra variables to pass in given the argument
>         % list for the call.
> "

Fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh>  |   but source code lives forever"
PGP: finger fjh at 128.250.37.3        |     -- leaked Microsoft memo.



More information about the developers mailing list