[m-rev.] for post-commit review: from_ground_term_initial

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Sep 8 16:04:49 AEST 2011


On Wed, 31 Aug 2011, Zoltan Somogyi wrote:

> Fix a problem with from_ground_term scopes. When they are built, the scopes
> are tentantively marked as from_ground_term_construct scopes, and the
> unifications inside them are in a top down order. Mode analysis therefore
> expected the unifications inside from_ground_term_construct scopes to have
> that order.
>
> The problem was that mode analysis, when it confirmed that a
> from_ground_term scope is indeed a from_ground_term_construct scope,
> itself reversed the order of the unifications, putting them in a bottom up
> order. When mode analysis is reinvoked, either for unique mode checking, or
> after cse_detection finds common subexpressions, this meant that
> mode analysis found the unifications in the "wrong" order, and therefore
> disregarded the scope, discarding all its performance benefits.
>
> This diff separates out the two notions that we previously conflated.
> The scope kind from_ground_term_construct now refers only to scopes
> which are definitely known to construct ground terms. We can know that
> only after mode analysis. Until then, from_ground_term scopes are now marked
> as from_ground_term_initial. The two kinds have different though overlapping
> sets of invariants; in particular, they promise different orderings of the
> unifications in the scope.
>
> This diff reduces the time needed to compile mas_objects.data.m
> from about 221 seconds to about 8.

...

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