[m-dev.] for review: improvements to intermodule specialization

Simon Taylor stayl at cs.mu.OZ.AU
Tue Sep 26 13:31:15 AEDT 2000


> Estimated hours taken: 6
> 
> Fix some problems with intermodule higher-order specialization that
> were preventing the compiler from properly specializing calls
> to list__sort/3, even at the highest optimization level.
> 
> compiler/intermod.m:
> 	Allow procedures which are called from exported procedures
> 	to be put in the `.opt' files.  This is needed e.g. for
> 	list__hosort.
 
> Index: compiler/intermod.m
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/compiler/intermod.m,v
> retrieving revision 1.84
> diff -u -d -r1.84 intermod.m
> --- compiler/intermod.m	2000/09/21 00:23:49	1.84
> +++ compiler/intermod.m	2000/09/25 14:36:25
> @@ -188,6 +188,7 @@
>  intermod__gather_preds([PredId | PredIds], CollectTypes,
>  		InlineThreshold, HigherOrderSizeLimit, Deforestation) -->
>  	intermod_info_get_module_info(ModuleInfo0),
> +	intermod_info_get_pred_decls(NewlyExportedPreds),
>  	{ module_info_preds(ModuleInfo0, PredTable0) },
>  	{ map__lookup(PredTable0, PredId, PredInfo0) },
>  	{ module_info_type_spec_info(ModuleInfo0, TypeSpecInfo) },
> @@ -195,7 +196,8 @@
>  	(
>  		{ intermod__should_be_processed(PredId, PredInfo0,
>  			TypeSpecForcePreds, InlineThreshold,
> -			HigherOrderSizeLimit, Deforestation, ModuleInfo0) }
> +			HigherOrderSizeLimit, Deforestation,
> +			NewlyExportedPreds, ModuleInfo0) }
>  	->
>  		=(IntermodInfo0),
>  		{ pred_info_clauses_info(PredInfo0, ClausesInfo0) },

It would probably be better not to rely on the predicates being
processed in the right order. It's also probably worth checking
multiple levels down, rather than just one.

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