[m-rev.] for review: deep profiling enchancements

Thomas Conway conway at cs.mu.OZ.AU
Tue Jun 5 09:40:18 AEST 2001


On Mon, Jun 04, 2001 at 03:01:57PM EST, Zoltan Somogyi wrote:
> For review by Tom.
> 
> Enhance deep profiling by
> 
> 	(1) optimizing self-tail-recursive calls by using a single service
> 	function, prepare_for_tail_call, instead of the prepare_for_normal_call
> 	and call_code pair. Since there is no callcode in the inner procedure,
> 	the inner procedure doesn't pick up the value of MiddleCSD, and thus
> 	cannot pass it to other service functions. Those functions therefore
> 	now pick up MiddleCSD from the global current_call_site_dynamic.
> 
> 	We also avoid calling set_current_csd in the exit and failure
> 	continuations after tail calls in the outer procedure, since their
> 	effects will be overridden by the exitcode or failcode of the outer
> 	procedure.
> 
> 	(2) using a prepare_for_method_call that is separate from
> 	prepare_for_ho_call, since extracting a key from a typeclass_info
> 	as if it were a closure is not robust
> 
> 	(3) adding callcode/exitcode/failcode to the unify/compare routines
> 	for the builtin types. This is necessary to record their identities
> 	and to count their exits and fails.
> 
> 	The resulting system should conform to the invariant that
> 	every prepare_for_special_call is matched either by the callcode
> 	of a builtin unify/compare routine or by the callcode of a
> 	compiler-generated __Unify__ or __Compare__ procedure.
> 
> The third change records information that we need. It leads to slowdown, but
> the speedup from the first change more than compensates for it. (The second
> change is performance neutral.)
> 
> compiler/deep_profiling:
> 	Modify the source transformation to achieve the effects described
> 	above.
> 
> library/profiling_builtin.m:
> 	Add prepare_for_tail_call and prepare_for_method_call.
> 
> 	Remove MiddleCSD from the argument list of service functions that do
> 	not need it.
> 
> 	Delete two unused predicates.
> 
> runtime/mercury_deep_profiling_hand.h:
> 	Do not pass MiddleCSD to the service functions from which that argument
> 	was removed.
> 
> runtime/mercury_deep_rec_depth_actions.h:
> runtime/mercury_deep_rec_depth_body.h:
> 	Fix a situation in which one local variable shadowed another.
> 
> runtime/mercury_ho_call.c:
> runtime/mercury_unify_compare_body.h:
> 	Add callcode/exitcode/failcode to the unify and compare routines
> 	of builtin types. Since these routines never call any other routine,
> 	we combine callcode/exitcode and callcode/failcode into one action.
> 
> 	Write out the proc_static structures of the unify/compare procedures
> 	for the builtin types.
> 
> runtime/mercury_deep_profiling.[ch]:
> 	Add statistics for the new service functions.
> 
> 	Add statistics for callbacks, for the sake of completeness.
> 
> 	Delete an unused argument from the histogram statistics functions.
> 
> Zoltan.
> 

These changes look fine.

-- 
  Thomas Conway )O+
 <conway at cs.mu.oz.au>       499 User error! Replace user, and press any key.
--------------------------------------------------------------------------
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