[m-dev.] for review: `possible' alias analysis stage

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Mar 10 19:54:37 AEDT 2000


On 10-Mar-2000, Nancy Mazur <Nancy.Mazur at cs.kuleuven.ac.be> wrote:
> 
> > > Added `possible' alias analysis stage (before unique modes analysis).
> > 
> > What's the rationale for this change?
> 
> Okay, here goes. 
> The `possible' alias analysis stage is one step of three in the 
> process of deriving liveness information. And liveness information
> itself is essential for a structure-reuse analysis which decides
> whether some datastructures can be reused or not (depending
> on the call pattern of the procedures). The reason why `possible'
> aliasing is needed in this process can be illustrated as follows: 
> 
> 	:- pred p(list(T)::in, list(T)::out, list(T)::out) is det.
> 	p( X, Y, Z ) :-
> 		q( X, Y ),  	     % - (Y might be aliased with X)
> 		(  X = [ Xe | Xs ]   % - does the top-level list-cel
> 				     % become available for reuse? 
> 				     % You can't be sure about that, due
> 				     % to the fact that Y might point to 
> 				     % this cel
> 		-> Z = [ Xe ]        % - so reuse here won't be allowed
> 		;  Z = [] ). 
> 		
> Is this a rationale enough? Or should it be explained more 
> thoroughly? 

Well, the Mercury compiler is already quite capable of
not reusing the top-level list cell in the example above ;-)
It would help more to have examples of where possible
aliasing information helps to reuse things that could not
otherwise be reused, using just the analyses that
Mercury compiler already performs (plus definite aliasing,
which is currently only supported on the `alias' branch).

If most of the reuse that we want to do can be done using just definite
aliasing, then it may not be worth the additional complexity of possible
aliasing analysis.

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