[m-rev.] for review: deleting code_exprn

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 14 21:35:45 AEST 2002


On 14-Oct-2002, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> On 14-Oct-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > Ah, now I remember which features of the lazy LLDS code generator are not
> > supported in the new LLDS code generator:
> > 	(1) --no-static-ground-terms
> > 	(2) the `jump' and `fast' grades.
> > 
> > Do we really want to get rid of those?
> > 
> > Note that (1) is currently needed for structure reuse,
> > e.g. the tests in tests/general/structure_reuse.
> 
> About (1):
> 
> Although I see that tests/general/structure_reuse/Mmakefile specifies
> --no-static-ground-terms, it doesn't specify --lazy-code,

I think it was written when --lazy-code was the default.
Probably it hasn't been tested with a more recent version of
the compiler because these tests only work on the reuse branch anyway.

> var_locn.m already has a predicate for creating a cell dynamically.
> Exporting it to code_info and making code_info export it to other modules
> would take about five minutes; I can do it in this diff. If we had a pass
> that marked unifications as must_be_dynamic, it would be trivial to modify
> unify_gen.m to use that version of the predicate instead of the one that
> checks for groundness first.

How about just modifying unify_gen.m to check the static_ground_terms
option and call the appropriate predicate first?
I don't think an additional pass to mark unifications is necessary.

> About (2), I don't know of anything that would make code_exprn and var_locn
> differ in their support for the jump and fast grades.

Sorry, my mistake.  I was completely wrong about that.  I was confusing
the static-ground-terms option with the code-addresses-are-const property.

> In short, this diff doesn't lose functionality on either point.

Well, it loses the functionality of --no-static-ground-terms --lazy-code.
This functionality is currently not being used (at least not in our code),
but it will be wanted on the reuse branch, and could also be useful
for other cases of user-written code.  Currently the Mercury compiler
does not conform to the Mercury language & library reference manuals
unless the --no-static-ground-terms option is used (see the XXX in
hard_coded/exceptions/tricky_try_store.m for an example of how it fails),
so I think this is a useful option to support ;-)

If implementing --no-static-ground-terms for the LLDS back-end is easy,
and from the above it sounds like it will be, then I'd suggest going
ahead and doing that, and then committing this patch (minus the
documentation changes for --no-static-ground-terms).

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list