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

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 18 04:23:04 AEDT 2000


On 17-Oct-2000, Peter Ross <petdr at miscrit.be> wrote:
> Remove the constraint the --infer-structure-reuse implies
> --no-static-ground-terms.
> 
> handle_options.m:
>     --infer-structure-reuse no longer implies --no-static-ground-terms.
>     
> mercury_compile.m:
>     Call mark static ground terms before calling structure reuse phase
>     so that we know which variables are constructed static.
>
> sr_data.m:
>     We cannot reuse a variable which was constructed statically.
> 
> sr_indirect.m:
>     Keep track of which variables are constructed statically.

Does this handle variables which are constructed statically
in a procedure then reused in a different procedure?

E.g.

	:- type f ---> f(int).

	:- pred foo(f::uo).
	:- pragma no_inline(foo/1).
	foo(f(42)).

	:- pred bar(f::di, f::uo).
	bar(Y, X) :-
		Y = f(A),
		X = f(A + 1).	% reuse Y

	:- pred baz(f::uo).
	baz(Y) :-
		foo(X),
		bar(X, Y).

Also what if the procedures are different modules?
Will it handle that case correctly?

-- 
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