[m-rev.] for review: dead_pred_elim optimization

Simon Taylor stayl at cs.mu.OZ.AU
Sat Mar 8 09:46:40 AEDT 2003


On 07-Mar-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> Estimated hours taken: 6
> Branches: main
> 
> Fix a performance bug where dead_pred_elim was taking a significant
> amount of time to delete entries from the predicate_table.  With this
> change dead_pred_elim goes from 12 minutes to 55 seconds CPU time in
> the IL grade when compiling accumulator.m with
> --intermodule-optimization turned on.
> diff -u compiler/hlds_module.m compiler/hlds_module.m
> --- compiler/hlds_module.m	5 Mar 2003 14:52:03 -0000
> +++ compiler/hlds_module.m	7 Mar 2003 15:31:16 -0000
> @@ -1094,7 +1094,8 @@
>  	% predicate_table size, as rather than removing entries from
>  	% the table it builds a new table from scratch.
>  
> -:- pred predicate_table_restrict(predicate_table::in, list(pred_id)::in,
> +:- pred predicate_table_restrict(module_info::in,
> +		predicate_table::in, list(pred_id)::in,
>  		predicate_table::out) is det.
>  
>  	% Set the pred_id->pred_info map.
> @@ -1765,16 +1766,30 @@
>  
>  %-----------------------------------------------------------------------------%
>  
> -predicate_table_restrict(OrigPredicateTable, PredIds, PredicateTable) :-
> +predicate_table_restrict(ModuleInfo,
> +		OrigPredicateTable, PredIds, PredicateTable) :-
>  	predicate_table_reset(OrigPredicateTable, PredicateTable0),
>  	predicate_table_get_preds(OrigPredicateTable, Preds),
> +	module_info_get_partial_qualifier_info(ModuleInfo, PartialQualInfo),

I'd suggest passing the partial_qualifier_info as an argument
to predicate_table_restrict instead of the module_info.

Otherwise, this looks fine.

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