[m-rev.] for review: inter-module analysis framework

Simon Taylor stayl at cs.mu.OZ.AU
Fri Aug 9 23:17:20 AEST 2002


On 09-Aug-2002, Nancy Mazur <Nancy.Mazur at cs.kuleuven.ac.be> wrote:
> * Simon Taylor <stayl at cs.mu.OZ.AU> [2002-08-09 13:56]:
> > I still don't understand why an analysis pass cares which variables
> > were present in the original program. If you are reading terms
> > containing variables from a file, and trying to match them against
> > terms computed during the current compilation, you will always
> > have to deal with renaming.
> 
> I don't mind the renaming, it'll always be needed of course, but I just
> need to know which variables correspond to the actual headvariables... 
> 
> Just for the small example of append... dumping out the hlds at stage 48
> or whatever gives something like: 
> append:app(TypeInfo_for_T, HeadVar__1, HeadVar__2, HeadVar__3):- 
> with a type-info variable artificially added to it... 
> but of course, in the analysis results, I don't care about TypeInfo's,
> even worse, I don't want them... I don't care whether the headvars are
> listed as [HeadVar__1, ..] or [A,B,C]... 

You haven't explained why you don't want the type-infos.
Type-infos can be heap allocated, so it makes sense to try to
optimize them using structure reuse, as in the following example:

:- pred write2(T::in, U::in, io__state::di, io__state::uo) is det.
write2(T, U) -->
	io__write([T]),
	io__write([U]).

Polymorphism will transform this into:

write2(TypeInfo_For_T, TypeInfo_For_U, T, U) -->
	{ TypeInfo_For_List_T = type_info_for_list(TypeInfo_For_T) },
	io__write(TypeInfo_For_List_T, T),
	{ TypeInfo_For_List_U = type_info_for_list(TypeInfo_For_U) },
	io__write(TypeInfo_For_List_U, U).

The construction of TypeInfo_For_List_U should be able to reuse
the cell allocated for TypeInfo_For_List_T if the analysis can
prove that `io__write' does not alias TypeInfo_For_List_T.
 
> But now that we're talking about renamings, some time ago I remember
> somebody (Zoltan?, Mark?) added a change so that during debugging the
> original names used by the programmer in the program are used instead
> of these awkward HeadVar__1, etc... 
> Can somebody point me to those changes, because the online search
> facilities are quite limited... 

http://www.cs.mu.oz.au/research/mercury/mailing-lists/mercury-reviews/mercury-reviews.0206/0027.html

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