[m-dev.] for review: constraint propagation

Simon Taylor stayl at cs.mu.OZ.AU
Thu Feb 24 10:12:34 AEDT 2000


> 
> On Wed, Feb 23, 2000 at 04:12:03PM EST, Simon Taylor wrote:
> > compiler/make_hlds.m:
> > 	Add `no_inline' marker to the "recursive" procedures
> > 	introduced for builtins to stop constraint propagation
> > 	attempting to specialize such procedures.
> 
> In general, we might want to inline a recursive procedure - call
> it loop unrolling. Or more importantly, if we find for example that
> append is called with an empty first arg very often, then we might
> decide to inline it into the caller....
> 
> In any case, I suggest using a different marker, say one called
> "recursive".

I haven't added `no_inline' markers to all recursive predicates, just
the ones introduced so that builtins can have their address taken.
(e.g. X + Y = X + Y.). The generated code for these is not recursive,
because the call in the body is generated as a call to the C builtin.
Inlining these predicates does not achieve anything. When constraint
propagation attempts to specialize these predicates, it introduces
infinite loops, because the call in the body is renamed.

Constraint propagation does specialize recursive procedures correctly --
the test case at the bottom of the diff is an example of that.

Simon.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list