[m-rev.] for post-commit review: mode_info speed up

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Aug 14 13:52:31 AEST 2007


On Tue, 14 Aug 2007, Zoltan Somogyi wrote:

> Improve the performance of the compiler by making sure that the mode_info
> structure contains only its most frequently updated and/or accessed fields
> and that these fit into an eight-word memory cell, moving the rest of the
> fields to the mode_sub_info structure. This improves performance on our
> standard benchmark from 20.60 seconds to 19.06 seconds, an improvement of 7%.
>
> compiler/mode_info.m:
> 	Make the change described above.
>
> 	Several fields of mode_sub_info were bools. Replace these with
> 	single-purpose types, to make them harder to mix up, especially
> 	during initialization.
>
> 	Similarly, replace the type of the field used for checking parallel
> 	conjunctions with a specialized type instead of a pair.
>
> 	Rename some predicates for greater consistency with the rest of the
> 	compiler.
>
> 	Rename field names to avoid ambiguities.
>
> 	Use the access predicates instead of field access syntax to access the
> 	fields of mode_info and mode_sub_info, to make any similar changes
> 	easier in the future, and also to make statistics about frequency
> 	of field accesses easier to gather.
>
> compiler/modecheck_call.m:
> compiler/modecheck_unify.m:
> compiler/modes.m:
> 	Conform to the changes in mode_info.
>
> compiler/modes.m:
> compiler/unique_modes.m:
> 	Do not execute the (save, set to known value, restore) sequence
> 	for the "duplicated for switch" feature unless necessary. This
> 	avoids a bunch of accesses and updates to the mode_sub_info.
>
> 	In both cases, this required moving some code that would otherwise
> 	have had to be duplicated into an inlined predicate.
>
> 	In unique_modes.m, rename a predicate to allow its name to be used
> 	for the new inlined predicate.
>
> compiler/Mercury.options:
> 	Change the inlining limit to allow those predicates to be inlined.

That looks fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list