[m-dev.] [reuse] diff: remove --no-static-ground-terms constraint on reuse

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 18 05:35:39 AEDT 2000


On 17-Oct-2000, Peter Ross <petdr at miscrit.be> wrote:
> On Wed, Oct 18, 2000 at 04:23:04AM +1100, Fergus Henderson wrote:
> > 
> > Does this handle variables which are constructed statically
> > in a procedure then reused in a different procedure?
> > 
> No it doesn't, aaargh!  You just need to mark which outputs of a
> procedure are constructed statically.  Not to difficult to do.
...
> you will need to introduce some sort of pragma which informs which
> outputs of a call are constructed statically, and write that into the
> trans_opt file.

I think it a different approach would be better:
rather than changing reuse analysis to carefully avoid reusing
anything that might be constructed statically,
I think it would be better to change static ground term optimization
so that it properly respects uniqueness declarations.

If you leave static ground term optimization as is, i.e. not respecting
the unique mode system, then you will need to make very conservative
assumptions in reuse analysis in cases involving type classes,
higher-order code, or the C interface, even if the procedures
are declared with `di' and `uo' modes.  The reason is that
reuse analysis will have no way of knowing what code is called
in those cases, and it can't tell from the modes, since
mode `di' will not necessary mean that the object is reusable.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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