[m-rev.] For review: Re-add --region-analysis option

Quan Phan quan.phan at cs.kuleuven.be
Thu Oct 4 16:51:46 AEST 2007


Hi there,

This change is pretty small and simple, can anyone take a look at it so
that I can commit. Will the change get into the nightly built of the
rotd if I commit it during the day.

Regards,
Quan.

On Wed, Oct 03, 2007 at 04:17:32PM +0200, Quan Phan wrote:
> Estimated hours taken: 0.1
> 
> Re-add option --region-analysis to enable region analysis. Currenly, we need
> both --region-analysis and --use-regions options because 
> 1. .rbmm implies --use-region which enables the inclusion of the region runtime code. Therefore the region runtime gets compiled in .rbmm grade.
> 2. The region analysis does not work with some constructs (higher-order terms,
> foreign code, ...) which appear in the compiler's code. So the
> --region-analysis option will prevent the region analysis from running when
> compiling in .rbmm grade.
> 
> To compile a program with rbmm we either compile it in asm_fast.gc.rbmm grade
> and specify --region-analysis at command line or specify both options
> explicitly at command line.
> 
> compiler/options.m:
> 	Add the --region-analysis option.
> 
> compiler/mercury_compile.m
> 	Use the option to turn on region analysis (instead of --use-regions).
> 
> ? diff_1003
> cvs diff: Diffing .
> Index: mercury_compile.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/mercury_compile.m,v
> retrieving revision 1.450
> diff -u -r1.450 mercury_compile.m
> --- mercury_compile.m	3 Oct 2007 12:11:54 -0000	1.450
> +++ mercury_compile.m	3 Oct 2007 13:46:19 -0000
> @@ -4272,7 +4272,7 @@
>  
>  maybe_region_analysis(Verbose, Stats, !HLDS, !IO) :-
>      module_info_get_globals(!.HLDS, Globals),
> -    globals.lookup_bool_option(Globals, use_regions, Analysis),
> +    globals.lookup_bool_option(Globals, region_analysis, Analysis),
>      (
>          Analysis = yes,
>          maybe_write_string(Verbose, "% Analysing regions ...\n", !IO),
> Index: options.m
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/compiler/options.m,v
> retrieving revision 1.586
> diff -u -r1.586 options.m
> --- options.m	3 Oct 2007 12:11:55 -0000	1.586
> +++ options.m	3 Oct 2007 13:46:21 -0000
> @@ -588,6 +588,7 @@
>      ;       distance_granularity
>      ;       parallelism_target
>      ;       implicit_parallelism
> +    ;       region_analysis
>  
>      % Stuff for the CTGC system (structure sharing / structure reuse).
>      ;       structure_sharing_analysis
> @@ -1379,6 +1380,7 @@
>      distance_granularity                -   int(0),
>      parallelism_target                  -   int(4),
>      implicit_parallelism                -   bool(no),
> +    region_analysis                     -   bool(no),
>  
>      % HLDS -> LLDS
>      smart_indexing                      -   bool(no),
> @@ -1895,6 +1897,7 @@
>  long_option("record-term-sizes-as-words", record_term_sizes_as_words).
>  long_option("record-term-sizes-as-cells", record_term_sizes_as_cells).
>  long_option("experimental-complexity",  experimental_complexity).
> +long_option("region-analysis",      region_analysis).
>  % (c) miscellaneous optional features
>  long_option("gc",                   gc).
>  long_option("garbage-collection",   gc).
> @@ -4478,6 +4481,9 @@
>          "\tinformation generated by mdprof_feedback.",
>          "\tThe profiling feedback file can be specified using the",
>          "\t--feedback file option."
> +% '--region-analysis' is not documented because it is still experimental.
> +%        "--region-analysis",
> +%        "\tEnable the analysis for region-based memory management."
>      ]).
>  
>  :- pred options_help_hlds_llds_optimization(io::di, io::uo) is det.
> cvs diff: Diffing notes
> --------------------------------------------------------------------------
> 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
> --------------------------------------------------------------------------
--------------------------------------------------------------------------
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