[m-rev.] for review: .opt files for intermodule analysis
Julien Fischer
juliensf at csse.unimelb.edu.au
Mon Feb 18 18:50:30 AEDT 2008
On Fri, 15 Feb 2008, Peter Wang wrote:
> Branches: main
>
> Support `.opt' files with `--intermodule-analysis'. Unlike with
> `--intermodule-optimisation', in this case `.opt' files only contain the
> initial information produced by `intermod.m' and not later analyses which
> should instead use the analysis framework. This makes intermodule inlining,
> etc. work with `--intermodule-analysis'. Also, the CTGC analyses will require
> the definitions of abstract types from imported modules.
>
> compiler/mercury_compile.m:
> Read and make `.opt' files with `--intermodule-analysis'.
>
> Don't run exception analysis, etc. when producing `.opt' files for
> `--intermodule-analysis'.
>
> Eliminate unnecessary clauses from `.opt' files to speed up
> compilation with `--intermodule-analysis', as we do for
> `--intermodule-optimisation'.
>
> compiler/make.dependencies.m:
> compiler/make.program_target.m:
> Account for `.opt' files being made with `--intermodule-analysis'
> in `mmc --make'.
>
> Make `.analysis' files dependent on `.opt' files.
s/dependent/depend/
> compiler/globals.m:
> Add a predicate to return whether either intermodule optimisation
> system is enabled.
>
> compiler/post_typecheck.m:
> Avoid spurious warning about duplicate mode declarations when using
> `--intermodule-analysis' as they may be read from `.opt' files (same
> as for `--intermodule-optimisation').
>
> compiler/exception_analysis.m:
> compiler/structure_sharing.analysis.m:
> compiler/tabling_analysis.m:
> compiler/trailing_analysis.m:
> compiler/unused_args.m:
> Don't write the analysis results into `.opt' files.
>
> compiler/term_constr_main.m:
> compiler/termination.m:
> Add todos for when these analyses are updated to support
> `--intermodule-analysis'.
>
> compiler/trans_opt.m:
> Fix a comment.
...
> %-----------------------------------------------------------------------------%
> Index: compiler/tabling_analysis.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/tabling_analysis.m,v
> retrieving revision 1.12
> diff -u -r1.12 tabling_analysis.m
> --- compiler/tabling_analysis.m 21 Jan 2008 00:32:54 -0000 1.12
> +++ compiler/tabling_analysis.m 15 Feb 2008 00:58:37 -0000
> @@ -125,6 +125,8 @@
> MakeOptInt, !IO),
> globals.io_lookup_bool_option(make_transitive_opt_interface,
> MakeTransOptInt, !IO),
> + globals.io_lookup_bool_option(intermodule_analysis,
> + IntermodAnalysis, !IO),
> globals.io_lookup_bool_option(make_analysis_registry,
> MakeAnalysisReg, !IO),
> Pass1Only = MakeOptInt `bool.or` MakeTransOptInt
> @@ -135,11 +137,15 @@
> globals.io_lookup_bool_option(debug_mm_tabling_analysis, Debug, !IO),
> list.foldl2(analyse_mm_tabling_in_scc(Debug, Pass1Only), SCCs,
> !ModuleInfo, !IO),
> + % Only write tabling pragmas to `.opt' files for
Strictly speaking they are mm_tabling_info pragmas; the tabling pragms are
rather different.
> + % `--intermodule-optimisation' not `--intermodule-analysis'.
> (
> MakeOptInt = yes,
> + IntermodAnalysis = no
> + ->
> make_opt_int(!.ModuleInfo, !IO)
> ;
> - MakeOptInt = no
> + true
> )
> ;
> UseMinimalModel = no
The diff looks fine. Could you please run some benchmarks between
compilers built using the two different intermodule optimization
systems. If there are no significant differences we should consider
using the new system by default (although that also means we will
need to use mmc --make by default as well - which is not without
its complications.)
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