[m-dev.] more unnecessary recompilation problems

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Feb 10 16:42:29 AEDT 2004


Every time I add a new ":- import_module" declaration to the *implementation*
section of module, Mmake decides to recompile the world.

This problems seems to have been introduced by Simon's equivalence type
changes.

What happens is that the ":- import_module" declarations in the
implementation section get included in the ".int" and ".int2" files,
which means that adding a new import declaration to a module forces
everything which directly or indirectly that module to be recompiled.

Here's an example .int2 file:

:- module (transform_hlds.loop_inv).
:- interface.
:- import_module hlds.
:- import_module (hlds.hlds_pred).
:- import_module (hlds.hlds_module).
:- implementation.
:- type rec_calls == (list.list(((transform_hlds.loop_inv).rec_call))).
:- type rec_call == (std_util.pair(((hlds.hlds_goal).hlds_goal), (list.list(((hl
ds.hlds_goal).hlds_goal))))).
:- type invariant_goal_candidates_acc.
:- type inst_info == {((hlds.hlds_module).module_info), ((hlds.instmap).instmap)
}.
:- type gen_aux_proc_info.
:- import_module (backend_libs.code_model).
:- import_module check_hlds.
:- import_module (check_hlds.det_util).
:- import_module (check_hlds.inst_match).
:- import_module (check_hlds.mode_util).
:- import_module (check_hlds.purity).
:- import_module (hlds.error_util).
:- import_module (hlds.hlds_goal).
:- import_module (hlds.hlds_data).
:- import_module (hlds.instmap).
:- import_module (hlds.quantification).
:- import_module (parse_tree.(inst)).
:- import_module (parse_tree.prog_data).
:- import_module (parse_tree.prog_util).
:- import_module list, assoc_list, std_util, require, set, term, string, bool.

If I understand things correctly, the import_module declarations in
the implementation section are needed in order to resolve references in
abstract equivalence types.  But in this case, the module doesn't
HAVE any abstract equivalence types -- it has some equivalence types,
but they are private, not abstract.  Why do they get put in the .int
or .int2 files?

Even in cases where there are abstract equivalences types, the types on
the right-hand sides of those are all fully-qualified at this point.
So we know exactly which modules they refer to.  Wouldn't it be better
to only import those modules which are actually referred to?

This problem is a serious compile time performance regression.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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