[m-dev.] for review: type specialization [1]
Simon Taylor
stayl at cs.mu.OZ.AU
Thu Feb 18 14:16:12 AEDT 1999
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.
> > +:- 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.
"
Simon.
More information about the developers
mailing list