[m-rev.] for review: [CTGC] generate optimised versions, reuse pragmas

Nancy Nancy.Mazur at cs.kuleuven.ac.be
Wed Jun 7 05:29:27 AEST 2006


Nancy Mazur wrote:
> Hi,
> 
> for anybody to review....
> 
> I've got one problem with the change below which also contains the mechanism
> to output structure_reuse pragma's, as well as reading them back in. Each 
> structure reuse pragma is related to a procedure. It dictates the
> conditions which a caller of this procedure needs to meet in order to
> safely replace the original call by a call to the optimised version of that
> procedure. This means that for each procedure, we create a separate (optimised)
> version (if optimisations are possible of course) with a compiler-generated
> name. This name is generated using the function: 
> 	
> 	generate_reuse_name(module_info, pred_proc_id) = reuse_name.
> 
> defined in structure_reuse.split, 
> which uses the predicate
> 	
> 	prog_util.make_pred_name_with_context/7
> 
> The problem is that this generates a name with a whole bunch of "__", and of
> course, once you print this name out, and read it back in, you get a sym_name
> with the strangest set of qualifiers. 
> 
> Just as an example. If I generate and print the name: 
> 	'concat.ctgc__pred__concatenate__0__0'
> then reading it back in (using prog_io.sym_name_and_args/3), and printing
> it back out again (in a hlds_dump file), this looks like this:
> 	((('concat.ctgc'.(pred)).concatenate).'0').'0'
> 	
> I don't really know what already exists to print and parse such sym_names
> correctly.  Can someone help me out on this one? 
> 
> Many thanks, 
> Nancy

On the reuse branch we solved this problem by ignoring the recorded name 
of the reuse version, and generating that name from scratch. Yet I feel 
a little uncomfortable with this solution. But perhaps I shouldn't?

Nancy

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

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